Projection

mongo4cats.operations.Projection
See theProjection companion class
object Projection extends Projection

Attributes

Companion
class
Graph
Supertypes
class Projection
trait AsJavaConverters
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
Projection.type

Members list

Value members

Inherited methods

def asJava[K, V](m: Map[K, V]): ConcurrentMap[K, V]

Attributes

Inherited from:
AsJavaConverters
def asJava[K, V](m: Map[K, V]): Map[K, V]

Attributes

Inherited from:
AsJavaConverters
def asJava[K, V](m: Map[K, V]): Map[K, V]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](s: Set[A]): Set[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](s: Set[A]): Set[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](s: Seq[A]): List[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](s: Seq[A]): List[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](b: Buffer[A]): List[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](i: Iterable[A]): Iterable[A]

Attributes

Inherited from:
AsJavaConverters
def asJava[A](i: Iterator[A]): Iterator[A]

Attributes

Inherited from:
AsJavaConverters
def asJavaCollection[A](i: Iterable[A]): Collection[A]

Attributes

Inherited from:
AsJavaConverters
def asJavaDictionary[K, V](m: Map[K, V]): Dictionary[K, V]

Attributes

Inherited from:
AsJavaConverters
def asJavaEnumeration[A](i: Iterator[A]): Enumeration[A]

Attributes

Inherited from:
AsJavaConverters
def combinedWith(anotherProjection: Projection): Projection

Merges 2 sequences of projection operations together. If there are duplicate keys, the last one takes precedence.

Merges 2 sequences of projection operations together. If there are duplicate keys, the last one takes precedence.

Value parameters

anotherProjection

the projection to be merged with

Attributes

Returns

the projection

Inherited from:
Projection
def computed[T](fieldName: String, expression: T): Projection

Creates a projection of a field whose value is computed from the given expression. Projection with an expression is only supported using the $project aggregation pipeline stage.

Creates a projection of a field whose value is computed from the given expression. Projection with an expression is only supported using the $project aggregation pipeline stage.

Value parameters

expression

the expression

fieldName

the field name

Attributes

Returns

the projection

Inherited from:
Projection
def computedSearchMeta(fieldName: String): Projection

Creates a projection of a field whose value is equal to the $$SEARCH_META variable, for use with Aggregate.search(SearchOperator,SearchOptions) / Aggregate.search(SearchCollector,SearchOptions). Calling this method is equivalent to calling computed(String,Object) with "$$SEARCH_META" as the second argument.

Creates a projection of a field whose value is equal to the $$SEARCH_META variable, for use with Aggregate.search(SearchOperator,SearchOptions) / Aggregate.search(SearchCollector,SearchOptions). Calling this method is equivalent to calling computed(String,Object) with "$$SEARCH_META" as the second argument.

Value parameters

fieldName

the field name

Attributes

Returns

the projection

Inherited from:
Projection
def elemMatch(fieldName: String, filter: Filter): Projection

Creates a projection that includes for the given field only the first element of the array value of that field that matches the given query filter.

Creates a projection that includes for the given field only the first element of the array value of that field that matches the given query filter.

Value parameters

fieldName

the field name

filter

the filter to apply

Attributes

Returns

the projection

Inherited from:
Projection
def elemMatch(fieldName: String): Projection

Creates a projection that includes for the given field only the first element of an array that matches the query filter. This is referred to as the positional $ operator.

Creates a projection that includes for the given field only the first element of an array that matches the query filter. This is referred to as the positional $ operator.

Value parameters

fieldName

the field name whose value is the array

Attributes

Returns

the projection

Inherited from:
Projection
override def equals(other: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Projection -> Any
Inherited from:
Projection
def exclude(fieldNames: Seq[String]): Projection

Creates a projection that excludes all of the given fields.

Creates a projection that excludes all of the given fields.

Value parameters

fieldNames

the field names

Attributes

Returns

the projection

Inherited from:
Projection
def exclude(fieldName: String): Projection

Creates a projection that excludes all of the given fields.

Creates a projection that excludes all of the given fields.

Value parameters

fieldName

the field name

Attributes

Returns

the projection

Inherited from:
Projection

Creates a projection that excludes the _id field. This suppresses the automatic inclusion of _id that is the default, even when other fields are explicitly included.

Creates a projection that excludes the _id field. This suppresses the automatic inclusion of _id that is the default, even when other fields are explicitly included.

Attributes

Returns

the projection

Inherited from:
Projection
override def hashCode(): Int

Calculates a hash code value for the object.

Calculates a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Definition Classes
Projection -> Any
Inherited from:
Projection
def include(fieldNames: Seq[String]): Projection

Creates a projection that includes all of the given fields.

Creates a projection that includes all of the given fields.

Value parameters

fieldNames

the field names

Attributes

Returns

the projection

Inherited from:
Projection
def include(fieldName: String): Projection

Creates a projection that includes all of the given fields.

Creates a projection that includes all of the given fields.

Value parameters

fieldName

the field name

Attributes

Returns

the projection

Inherited from:
Projection
def meta(fieldName: String, metaFieldName: String): Projection

Creates a $meta projection to the given field name for the given meta field name.

Creates a $meta projection to the given field name for the given meta field name.

Value parameters

fieldName

the field name

metaFieldName

the meta field name

Attributes

Returns

the projection

Inherited from:
Projection
def metaSearchHighlights(fieldName: String): Projection

Creates a projection to the given field name of the searchHighlights, for use with Aggregate.search(SearchOperator,SearchOptions) / Aggregates.search(SearchCollector,SearchOptions). Calling this method is equivalent to calling meta String,String) with "searchHighlights" as the second argument.

Creates a projection to the given field name of the searchHighlights, for use with Aggregate.search(SearchOperator,SearchOptions) / Aggregates.search(SearchCollector,SearchOptions). Calling this method is equivalent to calling meta String,String) with "searchHighlights" as the second argument.

Value parameters

fieldName

the field name

Attributes

Returns

the projection

Inherited from:
Projection
def metaSearchScore(fieldName: String): Projection

Creates a projection to the given field name of the searchScore, for use with Aggregate.search(SearchOperator,SearchOptions) / Aggregate.search(SearchCollector,SearchOptions). Calling this method is equivalent to calling meta(String,String) with "searchScore" as the second argument.

Creates a projection to the given field name of the searchScore, for use with Aggregate.search(SearchOperator,SearchOptions) / Aggregate.search(SearchCollector,SearchOptions). Calling this method is equivalent to calling meta(String,String) with "searchScore" as the second argument.

Value parameters

fieldName

the field name

Attributes

Returns

the projection

Inherited from:
Projection
def metaTextScore(fieldName: String): Projection

Creates a projection to the given field name of the textScore, for use with text queries.

Creates a projection to the given field name of the textScore, for use with text queries.

Value parameters

fieldName

the field name

Attributes

Returns

the projection

Inherited from:
Projection
def metaVectorSearchScore(fieldName: String): Projection

Creates a projection to the given field name of the vectorSearchScore, for use with Aggregate.vectorSearch(FieldSearchPath,Seq,String,Long,Long,VectorSearchOptions). Calling this method is equivalent to calling meta(String,String) with "vectorSearchScore" as the second argument.

Creates a projection to the given field name of the vectorSearchScore, for use with Aggregate.vectorSearch(FieldSearchPath,Seq,String,Long,Long,VectorSearchOptions). Calling this method is equivalent to calling meta(String,String) with "vectorSearchScore" as the second argument.

Value parameters

fieldName

the field name

Attributes

Returns

the projection

Inherited from:
Projection
def slice(fieldName: String, limit: Int): Projection

Creates a projection to the given field name of a slice of the array value of that field.

Creates a projection to the given field name of a slice of the array value of that field.

Value parameters

fieldName

the field name

limit

the number of elements to project.

Attributes

Returns

the projection

Inherited from:
Projection
def slice(fieldName: String, skip: Int, limit: Int): Projection

Creates a projection to the given field name of a slice of the array value of that field.

Creates a projection to the given field name of a slice of the array value of that field.

Value parameters

fieldName

the field name

limit

the number of elements to project

skip

the number of elements to skip before applying the limit

Attributes

Returns

the projection

Inherited from:
Projection
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Projection -> Any
Inherited from:
Projection