C# Class MongoDB.Driver.Collection

Inheritance: IMongoCollection
Afficher le fichier Open project: sdether/mongodb-csharp Class Usage Examples

Private Properties

Свойство Type Description
CheckError void
CheckPreviousError void

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
CheckError ( bool safemode ) : void
CheckPreviousError ( bool safemode ) : void

Method Details

Collection() public méthode

public Collection ( string name, Connection conn, string dbName ) : System
name string
conn Connection
dbName string
Résultat System

Count() public méthode

Count all items in the collection.
public Count ( ) : long
Résultat long

Count() public méthode

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
Résultat long

Delete() public méthode

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
Résultat void

Delete() public méthode

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
Résultat void

Find() public méthode

public Find ( Document spec ) : ICursor
spec Document
Résultat ICursor

Find() public méthode

public Find ( Document spec, int limit, int skip ) : ICursor
spec Document
limit int
skip int
Résultat ICursor

Find() public méthode

public Find ( Document spec, int limit, int skip, Document fields ) : ICursor
spec Document
limit int
skip int
fields Document
Résultat ICursor

Find() public méthode

public Find ( String where ) : ICursor
where String
Résultat ICursor

FindAll() public méthode

public FindAll ( ) : ICursor
Résultat ICursor

FindOne() public méthode

Finds and returns the first document in a query.
public FindOne ( Document spec ) : Document
spec Document /// A representing the query. ///
Résultat Document

Insert() public méthode

public Insert ( Document doc ) : void
doc Document
Résultat void

Insert() public méthode

Inserts the Document into the collection.
public Insert ( Document doc, bool safemode ) : void
doc Document
safemode bool
Résultat void

Insert() public méthode

public Insert ( IEnumerable docs ) : void
docs IEnumerable
Résultat void

Insert() public méthode

public Insert ( IEnumerable docs, bool safemode ) : void
docs IEnumerable
safemode bool
Résultat void

MapReduce() public méthode

Entrypoint into executing a map/reduce query against the collection.
public MapReduce ( ) : MapReduce
Résultat MapReduce

MapReduceBuilder() public méthode

public MapReduceBuilder ( ) : MapReduceBuilder
Résultat MapReduceBuilder

Save() public méthode

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
Résultat void

Update() public méthode

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
Résultat void

Update() public méthode

Updates a document with the data in doc as found by the selector.
public Update ( Document doc, Document selector ) : void
doc Document
selector Document
Résultat void

Update() public méthode

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 /// ///
Résultat void

Update() public méthode

public Update ( Document doc, Document selector, UpdateFlags flags, bool safemode ) : void
doc Document
selector Document
flags UpdateFlags
safemode bool
Résultat void

Update() public méthode

public Update ( Document doc, Document selector, bool safemode ) : void
doc Document
selector Document
safemode bool
Résultat void

Update() public méthode

public Update ( Document doc, Document selector, int flags ) : void
doc Document
selector Document
flags int
Résultat void

Update() public méthode

public Update ( Document doc, Document selector, int flags, bool safemode ) : void
doc Document
selector Document
flags int
safemode bool
Résultat void

Update() public méthode

public Update ( Document doc, bool safemode ) : void
doc Document
safemode bool
Résultat void

UpdateAll() public méthode

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
Résultat void

UpdateAll() public méthode

public UpdateAll ( Document doc, Document selector, bool safemode ) : void
doc Document
selector Document
safemode bool
Résultat void