Get All 'documents' from MongoDB 'collection'

前端 未结 3 1778
谎友^
谎友^ 2021-02-05 01:40

I need to retrieve all the documents that are in my collection in MongoDB, but I cannot figure out how. I have declared my \'collection\' like this-

private stat         


        
3条回答
  •  无人及你
    2021-02-05 02:25

    If you want all documents, why not use Find all?

    var documents = await SpeCollection.Find(new BsonDocument()).ToListAsync();
    

提交回复
热议问题