Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
122 changes: 122 additions & 0 deletions mongodb/MongoShellLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ NUMBER_DECIMAL: 'NumberDecimal';
TIMESTAMP: 'Timestamp';
REG_EXP: 'RegExp';

// Additional object constructors
BIN_DATA: 'BinData';
BINARY: 'Binary';
BSON_REG_EXP: 'BSONRegExp';
HEX_DATA: 'HexData';

// Collection methods
FIND: 'find';
FIND_ONE: 'findOne';
Expand All @@ -43,6 +49,81 @@ DISTINCT: 'distinct';
AGGREGATE: 'aggregate';
GET_INDEXES: 'getIndexes';

// Collection write methods (M2)
INSERT_ONE: 'insertOne';
INSERT_MANY: 'insertMany';
UPDATE_ONE: 'updateOne';
UPDATE_MANY: 'updateMany';
DELETE_ONE: 'deleteOne';
DELETE_MANY: 'deleteMany';
REPLACE_ONE: 'replaceOne';
FIND_ONE_AND_UPDATE: 'findOneAndUpdate';
FIND_ONE_AND_REPLACE: 'findOneAndReplace';
FIND_ONE_AND_DELETE: 'findOneAndDelete';

// Collection index/schema methods (M3)
CREATE_INDEX: 'createIndex';
CREATE_INDEXES: 'createIndexes';
DROP_INDEX: 'dropIndex';
DROP_INDEXES: 'dropIndexes';
DROP: 'drop';
RENAME_COLLECTION: 'renameCollection';
STATS: 'stats';
STORAGE_SIZE: 'storageSize';
TOTAL_INDEX_SIZE: 'totalIndexSize';
TOTAL_SIZE: 'totalSize';
DATA_SIZE: 'dataSize';
IS_CAPPED: 'isCapped';
VALIDATE: 'validate';
LATENCY_STATS: 'latencyStats';

// Database methods (M4)
CREATE_COLLECTION: 'createCollection';
DROP_DATABASE: 'dropDatabase';
HOST_INFO: 'hostInfo';
LIST_COMMANDS: 'listCommands';
SERVER_BUILD_INFO: 'serverBuildInfo';
SERVER_STATUS: 'serverStatus';
VERSION: 'version';
RUN_COMMAND: 'runCommand';
ADMIN_COMMAND: 'adminCommand';
GET_NAME: 'getName';
GET_MONGO: 'getMongo';
GET_SIBLING_DB: 'getSiblingDB';

// Connection methods
MONGO: 'Mongo';
CONNECT: 'connect';

// Replication methods
RS: 'rs';

// Sharding methods
SH: 'sh';

// Atlas stream processing
SP: 'sp';

GET_DB: 'getDB';
GET_READ_CONCERN: 'getReadConcern';
GET_READ_PREF: 'getReadPref';
GET_READ_PREF_MODE: 'getReadPrefMode';
GET_READ_PREF_TAG_SET: 'getReadPrefTagSet';
GET_WRITE_CONCERN: 'getWriteConcern';
SET_READ_PREF: 'setReadPref';
SET_READ_CONCERN: 'setReadConcern';
SET_WRITE_CONCERN: 'setWriteConcern';
START_SESSION: 'startSession';
WATCH: 'watch';
GET_DB_NAMES: 'getDBNames';

// Encryption methods
GET_KEY_VAULT: 'getKeyVault';
GET_CLIENT_ENCRYPTION: 'getClientEncryption';

// Plan cache methods
GET_PLAN_CACHE: 'getPlanCache';

// Cursor modifiers (methods)
SORT: 'sort';
LIMIT: 'limit';
Expand All @@ -51,6 +132,47 @@ PROJECTION: 'projection';
PROJECT: 'project';
COUNT: 'count';

// Bulk operation methods
INITIALIZE_ORDERED_BULK_OP: 'initializeOrderedBulkOp';
INITIALIZE_UNORDERED_BULK_OP: 'initializeUnorderedBulkOp';
EXECUTE: 'execute';
GET_OPERATIONS: 'getOperations';
TO_STRING: 'toString';
INSERT: 'insert';
REMOVE: 'remove';

// Additional cursor methods
BATCH_SIZE: 'batchSize';
CLOSE: 'close';
COLLATION: 'collation';
COMMENT: 'comment';
EXPLAIN: 'explain';
FOR_EACH: 'forEach';
HAS_NEXT: 'hasNext';
HINT: 'hint';
IS_CLOSED: 'isClosed';
IS_EXHAUSTED: 'isExhausted';
IT_COUNT: 'itcount';
MAP: 'map';
MAX: 'max';
MAX_AWAIT_TIME_MS: 'maxAwaitTimeMS';
MAX_TIME_MS: 'maxTimeMS';
MIN: 'min';
NEXT: 'next';
NO_CURSOR_TIMEOUT: 'noCursorTimeout';
OBJS_LEFT_IN_BATCH: 'objsLeftInBatch';
PRETTY: 'pretty';
READ_CONCERN: 'readConcern';
READ_PREF: 'readPref';
RETURN_KEY: 'returnKey';
SHOW_RECORD_ID: 'showRecordId';
SIZE: 'size';
TAILABLE: 'tailable';
TO_ARRAY: 'toArray';
TRY_NEXT: 'tryNext';
ALLOW_DISK_USE: 'allowDiskUse';
ADD_OPTION: 'addOption';

// Punctuation
LPAREN: '(';
RPAREN: ')';
Expand Down
Loading