Skip to content

Commit 8d77340

Browse files
committed
minor: implement unimplemented find options
1 parent d76b8d3 commit 8d77340

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/mongocxx/options/find.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ void find::comment(std::string comment) {
3434
_comment = comment;
3535
}
3636

37+
void find::cursor_type(enum cursor_type cursor_type) {
38+
_cursor_type = cursor_type;
39+
}
40+
3741
void find::limit(std::int32_t limit) {
3842
_limit = limit;
3943
}
@@ -78,6 +82,14 @@ const stdx::optional<std::int32_t>& find::batch_size() const {
7882
return _batch_size;
7983
}
8084

85+
const stdx::optional<std::string>& find::comment() const {
86+
return _comment;
87+
}
88+
89+
const stdx::optional<cursor_type>& find::cursor_type() const {
90+
return _cursor_type;
91+
}
92+
8193
const stdx::optional<std::int32_t>& find::limit() const {
8294
return _limit;
8395
}

src/mongocxx/options/find.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ namespace mongocxx {
2626
MONGOCXX_INLINE_NAMESPACE_BEGIN
2727
namespace options {
2828

29+
enum class cursor_type : std::uint8_t { k_non_tailable, k_tailable, k_tailable_await };
30+
2931
///
3032
/// Class representing the optional arguments to a MongoDB query.
3133
///
3234
class MONGOCXX_API find {
3335

3436
public:
35-
enum class cursor_type : std::uint8_t { k_non_tailable, k_tailable, k_tailable_await };
3637

3738
///
3839
/// Sets whether to allow partial results from a mongos if some shards are down (instead of
@@ -101,7 +102,7 @@ class MONGOCXX_API find {
101102
///
102103
/// @see http://docs.mongodb.org/meta-driver/latest/legacy/mongodb-wire-protocol/#op-query
103104
///
104-
void cursor_type(cursor_type cursor_type);
105+
void cursor_type(enum cursor_type cursor_type);
105106

106107
///
107108
/// Gets the current cursor type.

0 commit comments

Comments
 (0)