Database commands
Informix® supports a subset of the MongoDB database commands.
The basic syntax for database commands in the mongo shell is db.command(), where db refers to the current database, and command is the database command. You can use the mongo shell helper method db.runCommand() to run database commands on the current database.
User commands
- Aggregation commands
Table 1. Aggregation commands MongoDB command JSON collections Relational tables Details aggregate Yes Yes The wire listener supports version 2.4 of the MongoDB aggregate command, which returns a command result. For more information, see Aggregation framework operators. count Yes Yes distinct Yes Yes group No No mapReduce No No - Geospatial commands
Table 2. Geospatial commands MongoDB command JSON collections Relational tables Details geoNear Yes No Supported by using the GeoJSON format. The MongoDB legacy coordinate pairs are not supported. geoSearch No No geoWalk No No - Query and write operation commands
Table 3. Query and write operation commands MongoDB command JSON collections Relational tables Details delete Yes Yes eval No No findAndModify Yes Yes For relational tables, the findAndModify command is supported only for tables that have a primary key. This command does not support sharded data. getLastError Yes Yes getPrevError No No insert Yes Yes resetError No No text No No Text queries are supported by using the $text or $ifxtext query operators, not through the text command. update Yes Yes
Database operations
- Authentication commands
Table 4. Authentication commands Name Supported Details authenticate Yes authSchemaUpgrade Yes This command upgrades user data to MongoDB API version 2.6 or higher. logout Yes getnonce Yes - User management commands
Table 5. User management commands Name Supported Details createUser Yes Supported for MongoDB API version 2.6 or higher. dropAllUsersFromDatabase Yes Supported for MongoDB API version 2.6 or higher. dropUser Yes Supported for MongoDB API version 2.6 or higher. grantRolesToUser Yes Supported for MongoDB API version 2.6 or higher. revokeRolesFromUser Yes Supported for MongoDB API version 2.6 or higher. updateUser Yes Supported for MongoDB API version 2.6 or higher. usersInfo Yes Supported for MongoDB API version 2.6 or higher. - Role management commands
Table 6. Role management commands Name Supported Details createRole Yes Supported for MongoDB API version 2.6 or higher. dropAllRolesFromDatabase Yes Supported for MongoDB API version 2.6 or higher. dropRole Yes Supported for MongoDB API version 2.6 or higher. grantPrivilegesToRole Yes Supported for MongoDB API version 2.6 or higher. grantRolesToRole Yes Supported for MongoDB API version 2.6 or higher. invalidateUserCache No rolesInfo Yes Supported for MongoDB API version 2.6 or higher. revokePrivilegesFromRole Yes Supported for MongoDB API version 2.6 or higher. revokeRolesFromRole Yes Supported for MongoDB API version 2.6 or higher. updateRole Yes Supported for MongoDB API version 2.6 or higher. - Diagnostic commands
- Instance administration commands
Table 8. Instance administration commands Name JSON collections Relational tables Details clone No No cloneCollection No No cloneCollectionAsCapped No No collMod No No compact No No convertToCapped No No copydb No No create Yes No Informix does not support the following flags:- capped
- autoIndexID
- size
- max
createIndexes Yes Yes drop Yes Yes Informix does not lock the database to block concurrent activity.
dropDatabase Yes Yes dropIndexes Yes No The MongoDB deleteIndexes command is equivalent.
filemd5 Yes Yes fsync No No getParameter No No listCollections Yes Yes The includeRelational and includeSystem flags are supported to include or exclude relational or system tables in the results. Default is includeRelational=true and includeSystem=false.
listIndexes Yes Yes logRotate No No reIndex No No renameCollection No No repairDatabase No No setParameter No No shutdown Yes Yes The timeoutSecs flag is supported. In the Informix, the timeoutSecs flag determines the number of seconds that the wire listener waits for a busy client to stop working before forcibly terminating the session.
The force flag is not supported.
touch No No - Replication commands
Table 9. Replication commands Name Supported isMaster Yes replSetFreeze No replSetGetStatus No replSetInitiate No replSetMaintenance No replSetReconfig No replSetStepDown No replSetSyncFrom No Resync No - Sharding commands
Table 10. Replication commands Name JSON collections Relational tables Details addShard Yes Yes The MongoDB maxSize and name options are not supported.
In addition to the MongoDB command syntax for adding a single shard server, you can use the Informix specific syntax to add multiple shard servers in one command by sending the list of shard servers as an array. For more information, see Creating a shard cluster with MongoDB commands.
enableSharding Yes Yes This action is not required for Informix and therefore this command has no affect for Informix.
flushRouterConfig No No isdbgrid Yes Yes listShards Yes Yes The equivalent Informix command is cdr list server.
movePrimary No No removeShard No No shardCollection Yes Yes The equivalent Informix command is cdr define shardCollection.
The MongoDB unique and numInitialChunks options are not supported.
shardingState No No split No No
For more information about the MongoDB features, see http://docs.mongodb.org/manual/reference/.