MongoDBDriver/Collection.cs
/// <summary>
/// Finds and returns the first document in a query. 
/// </summary>
/// <param name="spec">
/// A <see cref="Document"/> representing the query.
/// </param>
/// <returns>
/// A <see cref="Document"/> from the collection.
/// </returns>
Finds and returns the first document in a query.
Finds and returns the first document in a query .
public Document FindOne(Document spec){
            ICursor cur = this.Find(spec, -1, 0, null);
            foreach(Document doc in cur.Documents){
                cur.Dispose();
                return doc;
            }
            return null; 
        }
public Document FindOne ( Document spec ) { ICursor cur = this . Find ( spec , - 1 , 0 , null ) ; foreach ( Document doc in cur . Documents ) { cur . Dispose ( ) ; return doc ; } return null ; }
Finds and returns the first document in a query.
Finds and returns the first document in a query .
//FIXME Decide if this should throw a not found exception instead of returning null. //this.Find(spec, -1, 0, null)[0];
A  from the collection.
A from the collection .
spec
Document
A  representing the query.
A representing the query .