C# Класс MongoDB.Driver.Collection

Наследование: IMongoCollection
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
CheckError void
CheckPreviousError void

Открытые методы

Метод Описание
Collection ( string name, Connection conn, string dbName ) : System
Count ( ) : long

Count all items in the collection.

Count ( Document spec ) : long

Count all items in a collection that match the query spec.

It will return 0 if the collection doesn't exist yet.

Delete ( Document selector ) : void

Deletes documents from the collection according to the spec.

An empty document will match all documents in the collection and effectively truncate it.

Delete ( Document selector, bool safemode ) : void

Deletes documents from the collection according to the spec.

An empty document will match all documents in the collection and effectively truncate it.

Find ( Document spec ) : ICursor
Find ( Document spec, int limit, int skip ) : ICursor
Find ( Document spec, int limit, int skip, Document fields ) : ICursor
Find ( String where ) : ICursor
FindAll ( ) : ICursor
FindOne ( Document spec ) : Document

Finds and returns the first document in a query.

Insert ( Document doc ) : void
Insert ( Document doc, bool safemode ) : void

Inserts the Document into the collection.

Insert ( IEnumerable docs ) : void
Insert ( IEnumerable docs, bool safemode ) : void
MapReduce ( ) : MapReduce

Entrypoint into executing a map/reduce query against the collection.

MapReduceBuilder ( ) : MapReduceBuilder
Save ( Document doc ) : void

Saves a document to the database using an upsert.

The document will contain the _id that is saved to the database. This is really just an alias to Update(Document) to maintain consistency between drivers.

Update ( Document doc ) : void

Updates a document with the data in doc as found by the selector.

_id will be used in the document to create a selector. If it isn't in the document then it is assumed that the document is new and an upsert is sent to the database instead.

Update ( Document doc, Document selector ) : void

Updates a document with the data in doc as found by the selector.

Update ( Document doc, Document selector, UpdateFlags flags ) : void

Updates a document with the data in doc as found by the selector.

Update ( Document doc, Document selector, UpdateFlags flags, bool safemode ) : void
Update ( Document doc, Document selector, bool safemode ) : void
Update ( Document doc, Document selector, int flags ) : void
Update ( Document doc, Document selector, int flags, bool safemode ) : void
Update ( Document doc, bool safemode ) : void
UpdateAll ( Document doc, Document selector ) : void

Runs a multiple update query against the database. It will wrap any doc with $set if the passed in doc doesn't contain any '$' ops.

UpdateAll ( Document doc, Document selector, bool safemode ) : void

Приватные методы

Метод Описание
CheckError ( bool safemode ) : void
CheckPreviousError ( bool safemode ) : void

Описание методов

Collection() публичный Метод

public Collection ( string name, Connection conn, string dbName ) : System
name string
conn Connection
dbName string
Результат System

Count() публичный Метод

Count all items in the collection.
public Count ( ) : long
Результат long

Count() публичный Метод

Count all items in a collection that match the query spec.
It will return 0 if the collection doesn't exist yet.
public Count ( Document spec ) : long
spec Document
Результат long

Delete() публичный Метод

Deletes documents from the collection according to the spec.
An empty document will match all documents in the collection and effectively truncate it.
public Delete ( Document selector ) : void
selector Document
Результат void

Delete() публичный Метод

Deletes documents from the collection according to the spec.
An empty document will match all documents in the collection and effectively truncate it.
public Delete ( Document selector, bool safemode ) : void
selector Document
safemode bool
Результат void

Find() публичный Метод

public Find ( Document spec ) : ICursor
spec Document
Результат ICursor

Find() публичный Метод

public Find ( Document spec, int limit, int skip ) : ICursor
spec Document
limit int
skip int
Результат ICursor

Find() публичный Метод

public Find ( Document spec, int limit, int skip, Document fields ) : ICursor
spec Document
limit int
skip int
fields Document
Результат ICursor

Find() публичный Метод

public Find ( String where ) : ICursor
where String
Результат ICursor

FindAll() публичный Метод

public FindAll ( ) : ICursor
Результат ICursor

FindOne() публичный Метод

Finds and returns the first document in a query.
public FindOne ( Document spec ) : Document
spec Document /// A representing the query. ///
Результат Document

Insert() публичный Метод

public Insert ( Document doc ) : void
doc Document
Результат void

Insert() публичный Метод

Inserts the Document into the collection.
public Insert ( Document doc, bool safemode ) : void
doc Document
safemode bool
Результат void

Insert() публичный Метод

public Insert ( IEnumerable docs ) : void
docs IEnumerable
Результат void

Insert() публичный Метод

public Insert ( IEnumerable docs, bool safemode ) : void
docs IEnumerable
safemode bool
Результат void

MapReduce() публичный Метод

Entrypoint into executing a map/reduce query against the collection.
public MapReduce ( ) : MapReduce
Результат MapReduce

MapReduceBuilder() публичный Метод

public MapReduceBuilder ( ) : MapReduceBuilder
Результат MapReduceBuilder

Save() публичный Метод

Saves a document to the database using an upsert.
The document will contain the _id that is saved to the database. This is really just an alias to Update(Document) to maintain consistency between drivers.
public Save ( Document doc ) : void
doc Document
Результат void

Update() публичный Метод

Updates a document with the data in doc as found by the selector.
_id will be used in the document to create a selector. If it isn't in the document then it is assumed that the document is new and an upsert is sent to the database instead.
public Update ( Document doc ) : void
doc Document
Результат void

Update() публичный Метод

Updates a document with the data in doc as found by the selector.
public Update ( Document doc, Document selector ) : void
doc Document
selector Document
Результат void

Update() публичный Метод

Updates a document with the data in doc as found by the selector.
public Update ( Document doc, Document selector, UpdateFlags flags ) : void
doc Document The to update with ///
selector Document /// The query spec to find the document to update. ///
flags UpdateFlags /// ///
Результат void

Update() публичный Метод

public Update ( Document doc, Document selector, UpdateFlags flags, bool safemode ) : void
doc Document
selector Document
flags UpdateFlags
safemode bool
Результат void

Update() публичный Метод

public Update ( Document doc, Document selector, bool safemode ) : void
doc Document
selector Document
safemode bool
Результат void

Update() публичный Метод

public Update ( Document doc, Document selector, int flags ) : void
doc Document
selector Document
flags int
Результат void

Update() публичный Метод

public Update ( Document doc, Document selector, int flags, bool safemode ) : void
doc Document
selector Document
flags int
safemode bool
Результат void

Update() публичный Метод

public Update ( Document doc, bool safemode ) : void
doc Document
safemode bool
Результат void

UpdateAll() публичный Метод

Runs a multiple update query against the database. It will wrap any doc with $set if the passed in doc doesn't contain any '$' ops.
public UpdateAll ( Document doc, Document selector ) : void
doc Document
selector Document
Результат void

UpdateAll() публичный Метод

public UpdateAll ( Document doc, Document selector, bool safemode ) : void
doc Document
selector Document
safemode bool
Результат void