Module: Mongoid::Extensions::Vector
| Relationships & Source Files | |
| Namespace Children | |
|
Modules:
| |
| Extension / Inclusion / Inheritance Descendants | |
|
Included In:
| |
| Defined in: | lib/mongoid/extensions/vector.rb |
Overview
Adds type-casting behavior to ::BSON::Vector class so that a field
declared with type: BSON::Vector is stored as a ::BSON binary of the
vector subtype and read back as a ::BSON::Vector.
Querying by an exact vector value (e.g. where(embedding: vector)) is
not supported: ::BSON::Vector subclasses Array, so the criteria selector
treats it as a list of elements rather than a scalar. Use Atlas Vector
Search ($vectorSearch) for similarity queries on vector fields.
Instance Method Summary
-
#mongoize ⇒ BSON::Binary | nil
Turn the object from the ruby type we deal with to a Mongo friendly type.
Instance Method Details
#mongoize ⇒ BSON::Binary | nil
Turn the object from the ruby type we deal with to a Mongo friendly type.