Skip to content

Commit

Permalink
Merge pull request #2804 from vibe-d/mongo_find_addition
Browse files Browse the repository at this point in the history
Add a MongoCollection.find(FindOptions) overload.
  • Loading branch information
s-ludwig authored Sep 11, 2024
2 parents 7633466 + 2e298d1 commit 97960ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/bench-mongodb/source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ void main()
}

logInfo("Running queries...");
static struct Q { int i; }
auto dur_query = runTimed({
struct Q { int i; }
foreach (i; 0 .. nqueries) {
auto res = coll.find!Item(Q(5));
res.front;
Expand Down
2 changes: 2 additions & 0 deletions mongodb/vibe/db/mongo/collection.d
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ struct MongoCollection {
- $(LREF findOne)
*/
MongoCursor!R find(R = Bson)() { return find!R(Bson.emptyObject, FindOptions.init); }
/// ditto
MongoCursor!R find(R = Bson)(FindOptions options) { return find!R(Bson.emptyObject, options); }

///
@safe unittest {
Expand Down

0 comments on commit 97960ed

Please sign in to comment.