C# Class MongoDB.Collection

Inheritance: System.Dynamic.DynamicObject
Show file Open project: dannycoates/mongo-clr4-driver Class Usage Examples

Public Methods

Method Description
BulkInsert ( ) : void
Collection ( string name, Database db, object>.IDictionary options = null ) : System

Create a new Collection object. If options are included, sends a command to the database, otherwise the reference is 'lazy'

Count ( ) : int
CreateIndex ( MongoDB.Index index, bool unique = false ) : string
DataSize ( ) : long
Distinct ( string key ) : IList
Drop ( ) : void

Drop this collection from its Database

DropIndex ( MongoDB.Index index ) : void
DropIndex ( string name ) : void
FindOne ( object>.IDictionary obj = null ) : Doc
GetIndexes ( ) : Cursor
Group ( ) : Doc
Insert ( object>.IDictionary obj, bool safe = false ) : object
MapReduce ( MapReduce mr ) : Doc
Remove ( object>.IDictionary spec, bool safe = false ) : void
Save ( object>.IDictionary obj, bool safe = false ) : object
Stats ( ) : Doc
StorageSize ( ) : long
TotalIndexSize ( ) : long
TryGetMember ( GetMemberBinder binder, object &result ) : bool
Update ( object>.IDictionary spec, object>.IDictionary doc, bool upsert = false, bool multi = false, bool safe = false ) : void

Private Methods

Method Description
Create ( object>.IDictionary options ) : void
EnsureIndex ( MongoDB.Index index ) : string
Find ( object>.IDictionary query = null, int limit, IEnumerable fields = null, int skip ) : Cursor
IndexName ( MongoDB.Index index ) : string
NameOk ( string name ) : bool

Method Details

BulkInsert() public method

public BulkInsert ( ) : void
return void

Collection() public method

Create a new Collection object. If options are included, sends a command to the database, otherwise the reference is 'lazy'
public Collection ( string name, Database db, object>.IDictionary options = null ) : System
name string
db Database
options object>.IDictionary /// valid options are: /// size - initial size (bytes), also max if capped /// capped - true if capped /// max - max object count if capped (optional) ///
return System

Count() public method

public Count ( ) : int
return int

CreateIndex() public method

public CreateIndex ( MongoDB.Index index, bool unique = false ) : string
index MongoDB.Index
unique bool
return string

DataSize() public method

public DataSize ( ) : long
return long

Distinct() public method

public Distinct ( string key ) : IList
key string
return IList

Drop() public method

Drop this collection from its Database
public Drop ( ) : void
return void

DropIndex() public method

public DropIndex ( MongoDB.Index index ) : void
index MongoDB.Index
return void

DropIndex() public method

public DropIndex ( string name ) : void
name string
return void

FindOne() public method

public FindOne ( object>.IDictionary obj = null ) : Doc
obj object>.IDictionary
return Doc

GetIndexes() public method

public GetIndexes ( ) : Cursor
return Cursor

Group() public method

public Group ( ) : Doc
return Doc

Insert() public method

public Insert ( object>.IDictionary obj, bool safe = false ) : object
obj object>.IDictionary
safe bool
return object

MapReduce() public method

public MapReduce ( MapReduce mr ) : Doc
mr MapReduce
return Doc

Remove() public method

public Remove ( object>.IDictionary spec, bool safe = false ) : void
spec object>.IDictionary
safe bool
return void

Save() public method

public Save ( object>.IDictionary obj, bool safe = false ) : object
obj object>.IDictionary
safe bool
return object

Stats() public method

public Stats ( ) : Doc
return Doc

StorageSize() public method

public StorageSize ( ) : long
return long

TotalIndexSize() public method

public TotalIndexSize ( ) : long
return long

TryGetMember() public method

public TryGetMember ( GetMemberBinder binder, object &result ) : bool
binder System.Dynamic.GetMemberBinder
result object
return bool

Update() public method

public Update ( object>.IDictionary spec, object>.IDictionary doc, bool upsert = false, bool multi = false, bool safe = false ) : void
spec object>.IDictionary
doc object>.IDictionary
upsert bool
multi bool
safe bool
return void