Skip to content
Success

Changes

Summary

  1. `mongo` command. (#81) (commit: fdcb756) (details)
Commit fdcb75634e4035c75853ab97a91bf4998942b6e6 by noreply
`mongo` command. (#81)

* Add initial WIP mongo support.

Can only connect and disconnect from the database. Still a Work In Progress.

* Added tag and beginning support for commands.

Added tag `<util.mongo_connections>` to get a list of valid connection ids.
Also added basic support for commands. Only works right now with commands that take an input of an integer. Example: `{ hello: 1}` or `{ dbStats: 1 }`.

* Add command support.

You can now run basic commands with the `command` action. An example would be like so:

- mongo id:my_db command:dbStats data:1

The above example issues the `dbStats` command with the parameter of `1`.

* `command_map` command for running a command with additional data.

Also changed `<entry[saveName].ok_result>` to `<entry[saveName].ok>`

* Add `find` action.

Can only find Documents. Cannot do any of the cool cursor operations, however. Maybe they are all possible with vanilla Denizen tags?

* Added `insert` action.

Also moved the collection things to the main connect action so you don't have to keep specifying the collection name.

* Added `update` action.

You can update and "upsert" Documents now.

* Make `find` action more consistent.

* Added `use_database` and `use_collection` actions.

Lets you switch the database or collection without having to create a new mongo instance.

* Add `by_id` option to the `find` action.

Lets you find based on the Document's ObjectId.

Also:
-> Updated error messages
-> Fixed ID returning as a weird value
-> Began to add support to final actions `create_database` and `create_collection`

* Removed `create_collection` and `create_database`

Inserting data into a database that does not exist will be created automatically by mongo.

* Add command documentation and examples.

* Change number of required arguments

* Remove old action matchers

Never implemented.

* Add info message about MongoDB console logging.

* Add NL@EOF

* Add cleanup and switched `schedule` functions to `runOnMainThread`

* Some more cleanup.

* Update to `autoExecute` and more cleanup.

Replaced `command`'s code with `command_map`'s code and discarded `command_map`. They did the same thing except one was meant for single commands only. The new `command` action can run single and multiple commands.
Also reordered `<util.mongo_connections>` to be near the same position as the other database tags and added `allowMongo` to CoreConfiguration.

* Add lowercased ID variable and shortened Java type conversion.

* Added `Connection` subclass and cleaned up `null` checks.

* Remove unnecessary `debugVerbose` check.

* Update error messages and `null` checks.

Also did a bit of comment cleanup.

* Re-add `debugVerbose` checks.

Error messages are helpful enough to where it should be up to the user whether or not to enable the stacktraces.
Also removed `null` check for `connection.connection`.
(commit: fdcb756)
The file was addedsrc/main/java/com/denizenscript/denizencore/scripts/commands/core/MongoCommand.java
The file was modifiedsrc/main/java/com/denizenscript/denizencore/tags/core/UtilTagBase.java (diff)
The file was modifiedsrc/main/java/com/denizenscript/denizencore/utilities/CoreConfiguration.java (diff)
The file was modifiedpom.xml (diff)
The file was modifiedsrc/main/java/com/denizenscript/denizencore/scripts/commands/CommandRegistry.java (diff)