Jump to content

Need help with MongoSK


Recommended Posts

Hello forums!
I'm a little stumped at the moment with a skript I am making. I am trying to use MongoSK for data storage on my server, but I am having issues getting MongoSK to cooperate with me. Could someone figure out what I am doing wrong, and/or a fix for this?


The following is a snippet of my test skript. This snippet is run within a command trigger.

# Assume {-mongo::players} is a collection with documents. One document has the field {"id":2}
# I am trying to retrieve the field "name" from the document where id=2, and message it (to the player within a command)

set {_query} to new mongo query
set mongo collection of {_query} to {-mongo::players}
set {_myfilter} to new mongosk filter where field "id" is 2
set mongo filter of {_query} to {_myfilter}
set {_doc} to first mongo document of query {_query}
message "%value ""name"" of {_doc}%"

The following is the errors I get when reloading:
image.png.fb298975a73a7c23d37f3519e838917b.png

Could anyone find a way to rid this skript of these errors and find out what (probably very obvious) mistake I have made?

Best regards,
Coder99513
 

Link to comment
Share on other sites

Looking at that, not sure why its not working. That looks similar to the example on skripthub docs. Do you have MongoSK 2?

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...