In accordance with MongoSK's release logic, this version includes versions 2.2.1 and 2.2.2 as well as some not yet released modifications that have been tested by several users. So make way for MongoSK 2.3.0! After a year without a new stable version, here is a new one that introduces a lot of new features. Let's start:
Highlighted additions
- ✨ Introduce embedded value beta expression
I've been asked for this expression a lot, so here it is! It is sometimes redundant to extract a document from a document from a document etc... and undertake several data manipulations on several lines. To remedy this, this expression will only ask you the path (MongoSK specific syntax, be careful) as follows:foo.bar
,foo[0].bar
orfoo.bar[2]
for example.
See example
{
"doc": {
".foo": "bar"
},
"list": [
{
"numbers": [
"1",
"2"
],
"hello": "world"
}
]
}
set {_docfoo} to mongo embedded value with path "doc.\.foo" of {doc}
broadcast "%{_docfoo}%" # Output: bar
set {_listnumbers} to mongo embedded value with path "list[0].numbers[1]" of {doc}
broadcast "%{_listnumbers}%" # Output: 2
set {_listhello} to mongo embedded value with path "list[0].hello" of {doc}
broadcast "%{_listhello}%" # Output: world
-
✨ Introduce sections support with new Skript's API and support legacy sections
Skript has recently released an API to create sections in a cleaner way directly integrated with Skript. However, this change has resulted in addons being required to use their new system. So I've been working to make sure that versions that are compatible with this change use it, but I've also been working to keep backwards compatibility for versions that don't use Skript's new API. To summarize, no changes are introduced by this release, only section support for recent versions of Skript. -
✨ Introduce mongo keys / values expressions
Also requested by many users, these expressions simply allow you to retrieve all the keys or values of a document. Practical, isn't it? -
✨ Introduce beta 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 aname
field, you can use this expression to retrieve all thename
fields of the documents in the collection.⚠️ This expression does not accept constructed queries, only the basic find query is currently supported.
Full Changelog: 2.2.0...2.3.0
I remind you that MongoSK has a Discord community on which you can exchange with other MongoSK users and contributors to get help and give us your opinions and what you would like to have in the addon!
That's it for today. Enjoy! 🤝