Skip to content

Commit 0b87289

Browse files
ooglekbjori
authored andcommitted
CDRIVER-1522 CDRIVER-1970 update define constants for "find" opts to be unique
1 parent 34be381 commit 0b87289

File tree

3 files changed

+153
-159
lines changed

3 files changed

+153
-159
lines changed

src/mongoc/mongoc-cursor-cursorid.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ _mongoc_cursor_prepare_getmore_command (mongoc_cursor_t *cursor,
193193

194194
/* See find, getMore, and killCursors Spec for batchSize rules */
195195
if (batch_size) {
196-
bson_append_int64 (command, BATCH_SIZE, BATCH_SIZE_LEN,
196+
bson_append_int64 (command, MONGOC_CURSOR_BATCH_SIZE, MONGOC_CURSOR_BATCH_SIZE_LEN,
197197
abs (_mongoc_n_return (cursor)));
198198
}
199199

@@ -204,14 +204,14 @@ _mongoc_cursor_prepare_getmore_command (mongoc_cursor_t *cursor,
204204
option maxAwaitTimeMS. If no maxAwaitTimeMS is specified, the driver
205205
SHOULD not set maxTimeMS on the getMore command."
206206
*/
207-
await_data = _mongoc_cursor_get_opt_bool (cursor, TAILABLE) &&
208-
_mongoc_cursor_get_opt_bool (cursor, AWAIT_DATA);
207+
await_data = _mongoc_cursor_get_opt_bool (cursor, MONGOC_CURSOR_TAILABLE) &&
208+
_mongoc_cursor_get_opt_bool (cursor, MONGOC_CURSOR_AWAIT_DATA);
209209

210210

211211
if (await_data) {
212212
max_await_time_ms = (int32_t) mongoc_cursor_get_max_await_time_ms (cursor);
213213
if (max_await_time_ms) {
214-
bson_append_int32 (command, MAX_TIME_MS, MAX_TIME_MS_LEN,
214+
bson_append_int32 (command, MONGOC_CURSOR_MAX_TIME_MS, MONGOC_CURSOR_MAX_TIME_MS_LEN,
215215
max_await_time_ms);
216216
}
217217
}

src/mongoc/mongoc-cursor-private.h

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -47,64 +47,64 @@ struct _mongoc_cursor_interface_t
4747
mongoc_host_list_t *host);
4848
};
4949

50-
#define ALLOW_PARTIAL_RESULTS "allowPartialResults"
51-
#define ALLOW_PARTIAL_RESULTS_LEN 19
52-
#define AWAIT_DATA "awaitData"
53-
#define AWAIT_DATA_LEN 9
54-
#define BATCH_SIZE "batchSize"
55-
#define BATCH_SIZE_LEN 9
56-
#define COLLATION "collation"
57-
#define COLLATION_LEN 9
58-
#define COMMENT "comment"
59-
#define COMMENT_LEN 7
60-
#define EXHAUST "exhaust"
61-
#define EXHAUST_LEN 7
62-
#define FILTER "filter"
63-
#define FILTER_LEN 6
64-
#define FIND "find"
65-
#define FIND_LEN 4
66-
#define HINT "hint"
67-
#define HINT_LEN 4
68-
#define LIMIT "limit"
69-
#define LIMIT_LEN 5
70-
#define MAX "max"
71-
#define MAX_LEN 3
72-
#define MAX_AWAIT_TIME_MS "maxAwaitTimeMS"
73-
#define MAX_AWAIT_TIME_MS_LEN 14
74-
#define MAX_SCAN "maxScan"
75-
#define MAX_SCAN_LEN 7
76-
#define MAX_TIME_MS "maxTimeMS"
77-
#define MAX_TIME_MS_LEN 9
78-
#define MIN "min"
79-
#define MIN_LEN 3
80-
#define NO_CURSOR_TIMEOUT "noCursorTimeout"
81-
#define NO_CURSOR_TIMEOUT_LEN 15
82-
#define OPLOG_REPLAY "oplogReplay"
83-
#define OPLOG_REPLAY_LEN 11
84-
#define ORDERBY "orderby"
85-
#define ORDERBY_LEN 7
86-
#define PROJECTION "projection"
87-
#define PROJECTION_LEN 10
88-
#define QUERY "query"
89-
#define QUERY_LEN 5
90-
#define READ_CONCERN "readConcern"
91-
#define READ_CONCERN_LEN 11
92-
#define RETURN_KEY "returnKey"
93-
#define RETURN_KEY_LEN 9
94-
#define SHOW_DISK_LOC "showDiskLoc"
95-
#define SHOW_DISK_LOC_LEN 11
96-
#define SHOW_RECORD_ID "showRecordId"
97-
#define SHOW_RECORD_ID_LEN 12
98-
#define SINGLE_BATCH "singleBatch"
99-
#define SINGLE_BATCH_LEN 11
100-
#define SKIP "skip"
101-
#define SKIP_LEN 4
102-
#define SNAPSHOT "snapshot"
103-
#define SNAPSHOT_LEN 8
104-
#define SORT "sort"
105-
#define SORT_LEN 4
106-
#define TAILABLE "tailable"
107-
#define TAILABLE_LEN 8
50+
#define MONGOC_CURSOR_ALLOW_PARTIAL_RESULTS "allowPartialResults"
51+
#define MONGOC_CURSOR_ALLOW_PARTIAL_RESULTS_LEN 19
52+
#define MONGOC_CURSOR_AWAIT_DATA "awaitData"
53+
#define MONGOC_CURSOR_AWAIT_DATA_LEN 9
54+
#define MONGOC_CURSOR_BATCH_SIZE "batchSize"
55+
#define MONGOC_CURSOR_BATCH_SIZE_LEN 9
56+
#define MONGOC_CURSOR_COLLATION "collation"
57+
#define MONGOC_CURSOR_COLLATION_LEN 9
58+
#define MONGOC_CURSOR_COMMENT "comment"
59+
#define MONGOC_CURSOR_COMMENT_LEN 7
60+
#define MONGOC_CURSOR_EXHAUST "exhaust"
61+
#define MONGOC_CURSOR_EXHAUST_LEN 7
62+
#define MONGOC_CURSOR_FILTER "filter"
63+
#define MONGOC_CURSOR_FILTER_LEN 6
64+
#define MONGOC_CURSOR_FIND "find"
65+
#define MONGOC_CURSOR_FIND_LEN 4
66+
#define MONGOC_CURSOR_HINT "hint"
67+
#define MONGOC_CURSOR_HINT_LEN 4
68+
#define MONGOC_CURSOR_LIMIT "limit"
69+
#define MONGOC_CURSOR_LIMIT_LEN 5
70+
#define MONGOC_CURSOR_MAX "max"
71+
#define MONGOC_CURSOR_MAX_LEN 3
72+
#define MONGOC_CURSOR_MAX_AWAIT_TIME_MS "maxAwaitTimeMS"
73+
#define MONGOC_CURSOR_MAX_AWAIT_TIME_MS_LEN 14
74+
#define MONGOC_CURSOR_MAX_SCAN "maxScan"
75+
#define MONGOC_CURSOR_MAX_SCAN_LEN 7
76+
#define MONGOC_CURSOR_MAX_TIME_MS "maxTimeMS"
77+
#define MONGOC_CURSOR_MAX_TIME_MS_LEN 9
78+
#define MONGOC_CURSOR_MIN "min"
79+
#define MONGOC_CURSOR_MIN_LEN 3
80+
#define MONGOC_CURSOR_NO_CURSOR_TIMEOUT "noCursorTimeout"
81+
#define MONGOC_CURSOR_NO_CURSOR_TIMEOUT_LEN 15
82+
#define MONGOC_CURSOR_OPLOG_REPLAY "oplogReplay"
83+
#define MONGOC_CURSOR_OPLOG_REPLAY_LEN 11
84+
#define MONGOC_CURSOR_ORDERBY "orderby"
85+
#define MONGOC_CURSOR_ORDERBY_LEN 7
86+
#define MONGOC_CURSOR_PROJECTION "projection"
87+
#define MONGOC_CURSOR_PROJECTION_LEN 10
88+
#define MONGOC_CURSOR_QUERY "query"
89+
#define MONGOC_CURSOR_QUERY_LEN 5
90+
#define MONGOC_CURSOR_READ_CONCERN "readConcern"
91+
#define MONGOC_CURSOR_READ_CONCERN_LEN 11
92+
#define MONGOC_CURSOR_RETURN_KEY "returnKey"
93+
#define MONGOC_CURSOR_RETURN_KEY_LEN 9
94+
#define MONGOC_CURSOR_SHOW_DISK_LOC "showDiskLoc"
95+
#define MONGOC_CURSOR_SHOW_DISK_LOC_LEN 11
96+
#define MONGOC_CURSOR_SHOW_RECORD_ID "showRecordId"
97+
#define MONGOC_CURSOR_SHOW_RECORD_ID_LEN 12
98+
#define MONGOC_CURSOR_SINGLE_BATCH "singleBatch"
99+
#define MONGOC_CURSOR_SINGLE_BATCH_LEN 11
100+
#define MONGOC_CURSOR_SKIP "skip"
101+
#define MONGOC_CURSOR_SKIP_LEN 4
102+
#define MONGOC_CURSOR_SNAPSHOT "snapshot"
103+
#define MONGOC_CURSOR_SNAPSHOT_LEN 8
104+
#define MONGOC_CURSOR_SORT "sort"
105+
#define MONGOC_CURSOR_SORT_LEN 4
106+
#define MONGOC_CURSOR_TAILABLE "tailable"
107+
#define MONGOC_CURSOR_TAILABLE_LEN 8
108108

109109
struct _mongoc_cursor_t
110110
{

0 commit comments

Comments
 (0)