Click or drag to resize

LiteCollectionT Methods

The LiteCollectionT type exposes the following members.

Methods
 NameDescription
Public methodCount Get document count in collection
Public methodCount(BsonExpression) Get document count in collection using predicate filter expression
Public methodCount(ExpressionFuncT, Boolean) Count documents matching a query. This method does not deserialize any documents. Needs indexes on query expression
Public methodCount(Query) Get document count in collection using predicate filter expression
Public methodCount(String, BsonDocument) Get document count in collection using predicate filter expression
Public methodCount(String, BsonValue) Get document count in collection using predicate filter expression
Public methodDelete Delete a single document on collection based on _id index. Returns true if document was deleted
Public methodDeleteAll Delete all documents inside collection. Returns how many documents was deleted. Run inside current transaction
Public methodDeleteMany(BsonExpression) Delete all documents based on predicate expression. Returns how many documents was deleted
Public methodDeleteMany(ExpressionFuncT, Boolean) Delete all documents based on predicate expression. Returns how many documents was deleted
Public methodDeleteMany(String, BsonDocument) Delete all documents based on predicate expression. Returns how many documents was deleted
Public methodDeleteMany(String, BsonValue) Delete all documents based on predicate expression. Returns how many documents was deleted
Public methodDropIndex Drop index and release slot for another index
Public methodEnsureIndex(BsonExpression, Boolean) Create a new permanent index in all documents inside this collections if index not exists already. Returns true if index was created or false if already exits
Public methodEnsureIndex(String, BsonExpression, Boolean) Create a new permanent index in all documents inside this collections if index not exists already. Returns true if index was created or false if already exits
Public methodEnsureIndexK(ExpressionFuncT, K, Boolean) Create a new permanent index in all documents inside this collections if index not exists already.
Public methodEnsureIndexK(String, ExpressionFuncT, K, Boolean) Create a new permanent index in all documents inside this collections if index not exists already.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodExists(BsonExpression) Get true if collection contains at least 1 document that satisfies the predicate expression
Public methodExists(ExpressionFuncT, Boolean) Get true if collection contains at least 1 document that satisfies the predicate expression
Public methodExists(Query) Get true if collection contains at least 1 document that satisfies the predicate expression
Public methodExists(String, BsonDocument) Get true if collection contains at least 1 document that satisfies the predicate expression
Public methodExists(String, BsonValue) Get true if collection contains at least 1 document that satisfies the predicate expression
Public methodFind(BsonExpression, Int32, Int32) Find documents inside a collection using predicate expression.
Public methodFind(ExpressionFuncT, Boolean, Int32, Int32) Find documents inside a collection using predicate expression.
Public methodFind(Query, Int32, Int32) Find documents inside a collection using query definition.
Public methodFindAll Returns all documents inside collection order by _id index.
Public methodFindById Find a document using Document Id. Returns null if not found.
Public methodFindOne(BsonExpression) Find the first document using predicate expression. Returns null if not found
Public methodFindOne(ExpressionFuncT, Boolean) Find the first document using predicate expression. Returns null if not found
Public methodFindOne(Query) Find the first document using defined query structure. Returns null if not found
Public methodFindOne(BsonExpression, BsonValue) Find the first document using predicate expression. Returns null if not found
Public methodFindOne(String, BsonDocument) Find the first document using predicate expression. Returns null if not found
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodInclude(BsonExpression) Run an include action in each document returned by Find(), FindById(), FindOne() and All() methods to load DbRef documents Returns a new Collection with this action included
Public methodIncludeK(ExpressionFuncT, K) Run an include action in each document returned by Find(), FindById(), FindOne() and All() methods to load DbRef documents Returns a new Collection with this action included
Public methodInsert(IEnumerableT) Insert an array of new documents to this collection. Document Id must be a new value in collection. Can be set buffer size to commit at each N documents
Public methodInsert(T) Insert a new entity to this collection. Document Id must be a new value in collection - Returns document Id
Public methodInsert(BsonValue, T) Insert a new document to this collection using passed id value.
Public methodInsertBulk Implements bulk insert documents in a collection. Usefull when need lots of documents.
Obsolete
Public methodLongCount Get document count in collection
Public methodLongCount(BsonExpression) Get document count in collection using predicate filter expression
Public methodLongCount(ExpressionFuncT, Boolean) Get document count in collection using predicate filter expression
Public methodLongCount(Query) Get document count in collection using predicate filter expression
Public methodLongCount(String, BsonDocument) Get document count in collection using predicate filter expression
Public methodLongCount(String, BsonValue) Get document count in collection using predicate filter expression
Public methodMax Returns the max _id index key value
Public methodMax(BsonExpression) Returns the max value from specified key value in collection
Public methodMaxK(ExpressionFuncT, K) Returns the last/max field using a linq expression
Public methodMin Returns the min value of _id index
Public methodMin(BsonExpression) Returns the min value from specified key value in collection
Public methodMinK(ExpressionFuncT, K) Returns the min value from specified key value in collection
Public methodQuery Return a new LiteQueryable to build more complex queries
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodUpdate(IEnumerableT) Update all documents
Public methodUpdate(T) Update a document in this collection. Returns false if not found document in collection
Public methodUpdate(BsonValue, T) Update a document in this collection. Returns false if not found document in collection
Public methodUpdateMany(BsonExpression, BsonExpression) Update many documents based on transform expression. This expression must return a new document that will be replaced over current document (according with predicate). Eg: col.UpdateMany("{ Name: UPPER($.Name), Age }", "_id > 0")
Public methodUpdateMany(ExpressionFuncT, T, ExpressionFuncT, Boolean) Update many document based on merge current document with extend expression. Use your class with initializers. Eg: col.UpdateMany(x => new Customer { Name = x.Name.ToUpper(), Salary: 100 }, x => x.Name == "John")
Public methodUpsert(IEnumerableT) Insert or Update all documents
Public methodUpsert(T) Insert or Update a document in this collection.
Public methodUpsert(BsonValue, T) Insert or Update a document in this collection.
Top
Extension Methods
 NameDescription
Public Extension MethodMethodInvoke Calls the object method by name.
(Defined by ObjectEx)
Public Extension MethodPropertyGet Gets the value of the object property by name.
(Defined by ObjectEx)
Public Extension MethodPropertyGetT Gets the value of the object property by name.
(Defined by ObjectEx)
Public Extension MethodPropertySet Sets the value of the object property by name.
(Defined by ObjectEx)
Top
See Also