using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace MongoDB { public partial interface IMongoCollection where T : class { /// /// Finds the first document in a selector query and returns it through the callback delegate. /// /// The where. /// The callback action. /// A for cancelling the task. CancellationTokenSource FindOneAsync(string javascriptWhere, Action returnDelegate); /// /// Finds the first document in a selector query and returns it through the callback delegate. /// /// The selector. /// The callback action /// A for cancelling the task. CancellationTokenSource FindOneAsync(object selector, Action returnDelegate); /// /// Gets a cursor that contains all of the documents in the collection and returns the cursor through the callback action. /// /// The callback delegate /// /// Cursors load documents from the database in batches instead of all at once. /// /// A for cancelling the task. CancellationTokenSource FindAllAsync(Action, Exception> returnDelegate); /// /// Uses the $where operator to query the collection. The value of the where is Javascript that will /// produce a true for the documents that match the criteria. /// Returns the cursor through the callback delegate. /// /// Javascript /// The callback delegate. /// A for cancelling the task. CancellationTokenSource FindAsync(string javascriptWhere, Action, Exception> returnDelegate); /// /// Queries the collection using the query selector and returns the cursor through the callback delegate. /// /// The selector. /// The callback delegate. /// A for cancelling the task. CancellationTokenSource FindAsync(object selector, Action, Exception> returnDelegate); /// /// Queries the collection using the specification and only returns a subset of fields through the callback delegate. /// /// The selector. /// The fields. /// The callback delegate /// A for cancelling the task. CancellationTokenSource FindAsync(object selector, object fields, Action, Exception> returnDelegate); /// /// Executes a query and atomically applies a modifier operation to the first document returning the original document /// by default through the callback delegate. /// /// The document. /// The selector. /// The callback delegate. /// A for cancelling the task. CancellationTokenSource FindAndModifyAsync(object document, object selector, Action returnDelegate); /// /// Executes a query and atomically applies a modifier operation to the first document returning the original document /// by default through the callback delegate. /// /// The document. /// The selector. /// containing the names of columns to sort on with the values being the /// The callback delegate. /// A for cancelling the task. /// CancellationTokenSource FindAndModifyAsync(object document, object selector, object sort, Action returnDelegate); /// /// Executes a query and atomically applies a modifier operation to the first document returning the original document /// by default through the callback delegate. /// /// The document. /// The selector. /// if set to true [return new]. /// The callback delegate. /// A for cancelling the task. CancellationTokenSource FindAndModifyAsync(object document, object selector, bool returnNew, Action returnDelegate); /// /// Executes a query and atomically applies a modifier operation to the first document returning the original document /// by default through the callback delegate. /// /// The document. /// The selector. /// containing the names of columns to sort on with the values being the /// /// if set to true [return new]. /// The callback delegate. /// A for cancelling the task. CancellationTokenSource FindAndModifyAsync(object document, object selector, object sort, bool returnNew, Action returnDelegate); /// /// Entrypoint into executing a map/reduce query against the collection. /// /// The callback delegate. /// A for cancelling the task. CancellationTokenSource MapReduceAsync(Action returnDelegate); /// /// Count all items in the collection. /// ///The callback delegate /// A for cancelling the task. CancellationTokenSource CountAsync(Action returnDelegate); /// /// Count all items in a collection that match the query selector. /// /// The selector. /// The callback delegate. /// A for cancelling the task. /// /// It will return 0 if the collection doesn't exist yet. /// CancellationTokenSource CountAsync(object selector, Action returnDelegate); /// /// Inserts the Document into the collection. /// /// The doc. /// The callback delegate for handling exceptions. /// A for cancelling the task. CancellationTokenSource InsertAsync(object document, bool safemode, Action exceptionHandler); /// /// Inserts the specified doc. /// /// The doc. /// The callback delegate for handling exceptions. /// A for cancelling the task. CancellationTokenSource InsertAsync(object document, Action exceptionHandler); /// /// Bulk inserts the specified documents into the database. /// /// The docs. /// The callback delegate for handling exceptions. /// /// See the safemode description in the class description /// /// A for cancelling the task. CancellationTokenSource InsertAsync(IEnumerable documents, bool safemode, Action exceptionHandler); /// /// Bulk inserts the specified documents into the database. /// /// The documents. /// The callback delegate for handling exceptions. /// A for cancelling the task. CancellationTokenSource InsertAsync(IEnumerable documents, Action exceptionHandler); /// /// Remove documents from the collection according to the selector. /// /// The selector. /// if set to true [safemode]. /// The callback delegate for handling exceptions. /// /// An empty document will match all documents in the collection and effectively truncate it. /// See the safemode description in the class description /// /// A for cancelling the task. CancellationTokenSource RemoveAsync(object selector, bool safemode, Action exceptionHandler); /// /// Remove documents from the collection according to the selector. /// /// The callback delegate for handling exceptions. /// The selector. /// /// An empty document will match all documents in the collection and effectively truncate it. /// /// A for cancelling the task. CancellationTokenSource RemoveAsync(object selector, Action exceptionHandler); /// /// Updates the specified document with the current document. In order to only do a partial update use a /// document containing modifier operations ($set, $unset, $inc, etc.) /// /// The document. /// The selector. /// if set to true [safemode]. /// The callback delegate for handling exceptions. /// /// See the safemode description in the class description /// /// A for cancelling the task. CancellationTokenSource UpdateAsync(object document, object selector, bool safemode, Action exceptionHandler); /// /// Updates the specified document with the current document. In order to only do a partial update use a /// document containing modifier operations ($set, $unset, $inc, etc.) /// /// The document. /// The selector. /// The callback delegate for handling exceptions. /// A for cancelling the task. CancellationTokenSource UpdateAsync(object document, object selector, Action exceptionHandler); /// /// Updates the specified document with the current document. In order to only do a partial update use a /// document containing modifier operations ($set, $unset, $inc, etc.) /// /// The document. /// The selector. /// The flags. /// if set to true [safemode]. /// The callback delegate to handle exceptions. /// /// See the safemode description in the class description /// /// A for cancelling the task. CancellationTokenSource UpdateAsync(object document, object selector, UpdateFlags flags, bool safemode, Action exceptionHandler); /// /// Updates the specified document with the current document. In order to only do a partial update use a /// document containing modifier operations ($set, $unset, $inc, etc.) /// /// The to update with /// The query selector to find the document to update. /// /// The callback delegate for handling exceptions. /// A for cancelling the task. CancellationTokenSource UpdateAsync(object document, object selector, UpdateFlags flags, Action exceptionHandler); /// /// Runs a multiple update query against the database. It will wrap any /// doc with $set if the passed in doc doesn't contain any '$' modifier ops. /// /// The document. /// The selector. /// The callback delegate for handling exceptions. /// A for cancelling the task. CancellationTokenSource UpdateAllAsync(object document, object selector, Action exceptionHandler); /// /// Runs a multiple update query against the database. It will wrap any /// doc with $set if the passed in doc doesn't contain any '$' modifier ops. /// /// The document. /// The selector. /// if set to true [safemode]. /// The callback delegate for handling exceptions. /// /// See the safemode description in the class description /// /// A for cancelling the task. CancellationTokenSource UpdateAllAsync(object document, object selector, bool safemode, Action exceptionHandler); /// /// Inserts or updates a document in the database. If the document does not contain an _id one will be /// generated and an upsert sent. Otherwise the document matching the _id of the document will be updated. /// /// The document. /// The callback delegate for handling exceptions. /// /// The document will contain the _id that is saved to the database. /// /// A for cancelling the task. CancellationTokenSource SaveAsync(object document, Action exceptionHandler); /// /// Saves a document to the database using an upsert. /// /// The document. /// if set to true [safemode]. /// The callback delegate for handling exceptions. /// A for cancelling the task. CancellationTokenSource SaveAsync(object document, bool safemode, Action exceptionHandler); } }