Skip to content
fb95950
Compare
Choose a tag to compare
Pre-release

It's been a few months since I've made any updates to MongoSK, and it's high time to make these changes to keep MongoSK up to date with the new stuff (it goes so fast 馃槰). There are no major changes or features added in this minor release, mostly code maintenance.

What's Changed

  • 猬嗭笍 Bump Skript from 2.6-beta2 to 2.6
  • 猬嗭笍 Bump mongodb-driver-reactivestreams from 4.3.1 to 4.4.1
  • 猬嗭笍 Bump com.github.johnrengelman.shadow from 7.0.0 to 7.1.2
  • 猬嗭笍 Bump actions/checkout from 2.3.4 to 2.4.0
  • 馃攰 Properly use the Bukkit logger to display beautiful logs
  • Introduce mongo keys / values expressions
  • 馃摑 Mark distinct query expression as non-beta
  • 馃懡 Update Skript code due to API changes

Full Changelog: 2.2.1...2.2.2

That's all for this update, however be reassured, other updates bringing new features that you asked me for are coming in a few weeks. Have fun! 馃槑

Compare
Choose a tag to compare

馃崈 Bug fix time!

Pre-release
Pre-release

This update brings a major bug fix to the Mongo document creation effects sections. The behavior of the current syntax remains unchanged. However, a new feature has been added: you can now implicitly specify the type of fields you want to add.

Example:

set {_doc} to a new mongo document with:
  mongo "a": 1, 2 and 3
  mongo list "b": 4, 5 and 6
  mongo list "c": 1
  mongo "d": 7
  mongo value "e": 8
  mongo value "f": 9 and 10

鉃★笍 {"a": [1, 2, 3], "b": [4, 5, 6], "c": [1], "d": 7, "e": 8, "f": 9}

Then, a beta syntax was added because I was asked for it a lot: the distinct query. The distinct query is useful when you want to retrieve a specific field from each document in a given collection. For example, if you have documents with a name field, you can use this expression to retrieve all the name fields of the documents in the collection. Useful, isn't it?

That's it for today. Enjoy! 馃

Compare
Choose a tag to compare

In the continuity of the versioning cycle of MongoSK, consisting in using the patch versions of beta releases as and when features are added, the previous beta versions have proven to be stable. It's time to release MongoSK 2.2.0. Let's see what's new.

Major changes

  • Fix query execution of advanced queries
  • Fix the server expression that did not support color codes properly
  • Add support for Skript 2.6+
  • Add support for MC 1.8+
  • Add ability to disable codecs:

As you know, MongoSK comes with codecs, which allow users to easily store information not supported by MongoDB. For example: locations, players, dates, etc. It is now possible for advanced users who know what they are doing to disable some codecs so that they are no longer operational. Here is how to do it if you want to disable the date and player codecs for example:

skript-adapters:
    # ...
    # The list of codec names that you do not want to be activated. One per line, starting with a hyphen.
    disabled:
    - date
    - player
  • Add easy configuration of timeouts:

It is now possible to easily customize the timeout of the Mongo driver operations! As you know, the default timeouts are 30 seconds, which means that the main server thread will be blocked for 30 seconds (if your request is not executed asynchronously). From now on, the default timeout is set to 10 seconds, and can be customized in the MongoSK configuration as follows:

# The timeouts represent the maximum time to wait before the action is completed.
# If the action is not completed before the time defined below, it will be aborted.
# Timeouts are expressed in milliseconds. It is not recommended to define a timeout greater than 10000 milliseconds.
timeouts:
    # The connection timeout to your server.
    connect: 10000
    # The timeout for reading the data received from the server.
    read: 10000

For more information about some of the changes, see the 2.0.1 & 2.0.2 releases. That's it for today. Enjoy!

Compare
Choose a tag to compare
Pre-release

馃敪 MC 1.8 support
This version brings the modification of the Maven repository of the Mongo driver, now hosted by myself. The reason is that some issues have been fixed on my fork, adding support among others for 1.8 servers! This modified version of the driver does not use SLF4J anymore, which was not present on these servers.

馃悰 Skript 2.6 compatibility fix
The second fix brings full compatibility with Skript 2.6. The effect sections have been fixed, and should no longer display warnings in the console.

That's all for today. Have fun!

Compare
Choose a tag to compare
Pre-release

This version fixes a major problem with advanced queries. Indeed, some properties of the Skript query were not correctly "translated" to make a Mongo query to the database, returning an incorrect result. Everything is fixed now.

In addition, compatibility with Skript 2.6-alpha1 has been added.
Note that this version of Skript remains unstable and should not be used in production.

鈿狅笍 Special notice to servers using the visualEffect codec: due to Skript changes and in order to be compatible with 2.6-alpha1, this codec will no longer work with versions before Skript 2.6. If you use it, it is not recommended to upgrade to MongoSK 2.1.1, but to wait for Skript 2.6 to be stable in order to upgrade MongoSK.

As always, I remain available if you need help or more information!

Compare
Choose a tag to compare

The previous patch versions (2.0.1, 2.0.2 & 2.0.3) proved to be stable and without bugs, so here is a minor version (2.1.0)! This new version also brings some new features:

Features

  • Update Mongo driver from version 4.2.2 to 4.3.0-beta1 (24d55b6)
  • Remove severe logging when a field does not exist in a document (dce8007)
  • Add an is empty document condition (cb6333c)
  • Add an has value document condition (b8fc290)
  • Add an has key document condition (9424283)
  • Add Mongo sections! (8908f7c)

As you know, the creation of simple documents can sometimes be long and boring, because of the many lines that sometimes seem unnecessary.
To create a simple document representing the JSON object below, you can now use a new syntax! 猬囷笍

{
  "simpleField": "Hello!",
  "nestedObject": {
    "number": 100,
    "boolean": false
  }
}
set {_nested} to a new mongo document with:
  mongo "number": 100
  mongo "boolean": false
set {_doc} to a new mongo document with:
  mongo "simpleField": "Hello!"
  mongo "nestedObject": {_nested}
broadcast {_doc}'s mongo json

These new syntaxes are all prefixed with mongo to ensure they do not conflict with other addons.
As a reminder, they are currently in beta, and their patterns may be changed if there are problems. 馃憤

That's it for today, enjoy!

Compare
Choose a tag to compare

馃崈 New features!

Pre-release
Pre-release

Finally we come to an update with some new features!
Right away, recap:

馃悰 Bugs

  • Fix syntaxes typos ([a [new]] -> [[a] new]) (477d76e)
  • Make Skript dependent instead of softdependent (should fix some issues on some MC hosting providers) (cf0f385)

Features

  • Introducing array support in joined filters expression (ebf2dc7)
  • Introducing Mongo collection creation (4ca89cc)
  • Introducing Mongo database and collection drops (ee18121)
  • Allow use of raw BSON documents (f7c37fd), i.e. :
{
  "foo": {
    "bar": true
  },
  "array": [
    {
      "test": false
    }
  ]
}
set {_doc} to a new mongo document
set mongo json of {_doc} to "{""foo"":{""bar"":true},""array"":[{""test"":false}]}"

set {_fooDoc} to mongo value "foo" of {_doc} # {_fooDoc} = {"bar":true}
set {_bar} to mongo value "bar" of {_fooDoc} # {_bar} = true

set {_array::*} to mongo list "array" of {_doc}
set {_first} to {_array::1} # {_array::1} = {"test":false}
set {_test} to mongo value "test" of {_first} # {_test} = false
  • Introducing Mongo commands! (0a23b45), i.e. :
on script load:
    set {server} to mongo server with connection string "mongodb://127.0.0.1"
    set {database} to mongo database named "mongosk" of {server}

function getClusterVersion() :: string:
    set {_docs::*} to results of mongo command "{ ""serverStatus"": 1 }" in database {database}
    set {_doc} to {_docs::1}

    # or directly:
    set {_doc} to first element of results of mongo command "{ ""serverStatus"": 1 }" in database {database}
      
    # return the mongo value "version" of the returned document:
    set {_version} to mongo value "version" of {_doc}
    return {_version}

on mongo command start:
    broadcast "Mongo command %event-mongodocument% in collection named %event-string% started!"

on mongo command success:
    broadcast "Mongo command %event-mongodocument% succedeed in %event-number% ms!"

on mongo command fail:
    broadcast "A Mongo command failed with error: %event-string% (took %event-number% ms)!"

That's it for today. And that's not bad.
Thanks to you for your feedback! As always, don't hesitate to contact me if you have any problem.

Compare
Choose a tag to compare
Pre-release

This new update brings many fixes. This one doesn't bring any additional big feature, because like the previous one, I prefer to concentrate on the bugs to be solved. But don't worry, some new features are still being developed in parallel! 馃憖

馃悰 Bugs

  • Better error catching (6018854)
  • Fix some errors on the mongo document field expression (53c2b7e)
  • Fix issues with mongo document lists (e6c3767)
  • Fix not recognised syntaxes when using numbers (fe23964)
  • Fix incorrect query time display (72910d0)
  • Fix error with empty value filters, like mongosk filter where filter "foo" is set (2fb5cfd)
  • Fix entity codec (ec80be3)
  • Fix documentations with invalid examples (e215234)

Features

  • You can now delete documents without having to specify a filter, as MongoSK will set an empty filter by default if you do not specify one. The same goes for defining documents (9258c56)

As always, if you have any suggestions, problems or need help, I am always available to help you!

Compare
Choose a tag to compare

馃崈 Some bug fixes

Pre-release
Pre-release

Thank you all for your feedback on MongoSK 2.0.0. Thanks to you, some issues have been solved. Let's review them:

馃悰 Bugs

For this update, no additions have been made, while we receive feedback on the stability of this first v2 version. New features will be added soon.

08cc53e
Compare
Choose a tag to compare

As expected and planned for some time, here it is at last! MongoSK v2 makes place. On the program:

  • 鈿★笍 Database queries are executed asynchronously
    The code has been rewritten using the mongodb-driver-reactivestreams library

  • 鈿欙笍 Automatic and intelligent transformation of all sorts of data
    You can now store all types of Skript as items, players, blocks, etc. MongoSK does the job for you!

  • 馃攰 Simple and understandable debugging to quickly identify problems
    The information are relevant and useful for both novice users and developers of the plugin

  • 馃敩 Addition of advanced queries for specific queries
    You are now able to target more precise data in your queries with a lot of options

  • 馃 More logical and smart syntaxes
    Syntaxes have been reworked to be more consistent and logical

馃 So, how to update from MongoSK 1 to MongoSK 2?

All information is available on a specially created discussion here: #23. If you still need help, you can come to the Discord server or ask for help in GitHub discussions. All links are on the main page.