summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbhelpers.h
diff options
context:
space:
mode:
authorDianna Hohensee <dianna.hohensee@10gen.com>2016-03-25 12:58:52 -0400
committerDianna Hohensee <dianna.hohensee@10gen.com>2016-04-05 13:07:53 -0400
commit02779909333ff4333c316b54b9fbb2fdd635e15a (patch)
tree53a69544446c0629fbbaea45a194e02869aa0e97 /src/mongo/db/dbhelpers.h
parent9b3f5992a38b05d0e11215a25fd63bd3fdf890ab (diff)
downloadmongo-02779909333ff4333c316b54b9fbb2fdd635e15a.tar.gz
SERVER-23445 create LocalClient class for local queries/writes, implement a find query interface
Diffstat (limited to 'src/mongo/db/dbhelpers.h')
-rw-r--r--src/mongo/db/dbhelpers.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/mongo/db/dbhelpers.h b/src/mongo/db/dbhelpers.h
index 53d0839711b..334857bd10a 100644
--- a/src/mongo/db/dbhelpers.h
+++ b/src/mongo/db/dbhelpers.h
@@ -69,23 +69,26 @@ struct Helpers {
bool unique,
const char* name);
- /* fetch a single object from collection ns that matches query.
- set your db SavedContext first.
-
- @param query - the query to perform. note this is the low level portion of query so
- "orderby : ..." won't work.
-
- @param requireIndex if true, assert if no index for the query. a way to guard against
- writing a slow query.
-
- @return true if object found
- */
+ /**
+ * Fetches a single BSONObj document from the given collection that matches query.
+ *
+ * @param collection - collection to be queried.
+ * @param query - the query to perform. Note this is the low level portion of query so
+ * "orderby : ..." won't work.
+ * @param result - holds the found BSONObj document, if found.
+ * @param requireIndex - if true, assert if no index for the query. A way to guard against
+ * writing a slow query.
+ * @return true if a document is found.
+ */
static bool findOne(OperationContext* txn,
Collection* collection,
const BSONObj& query,
BSONObj& result,
bool requireIndex = false);
+ /**
+ * Fetches the RecordId location of a single object from collection ns that matches query.
+ */
static RecordId findOne(OperationContext* txn,
Collection* collection,
const BSONObj& query,