Issues with MongoSK

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

P e t e

Member
May 29, 2021
2
0
1
Skript Version: Skript 2.2 (dev20c)
Skript Author: Coder99513
Minecraft Version: 1.16.5
---
Full Code:
Code:
on load:
    if {-mongo::*} is set:
        close connection {-mongo::client}
        delete {-mongo::*}
    create a new mongo client to host "mongodb+srv://[removed for privacy]" named "mongo"
    set {-mongo::client} to client named "mongo"
    set {-mongo:db} to mongo database named "mc" with {-mongo::client}
    set {-mongo::players} to mongo collection "players" in {-mongo::db}
command /dbget <string>:
    permission: sk.admin
    trigger:
        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}%"
Errors on Reload:
image.png.fb298975a73a7c23d37f3519e838917b.png


Addons using (including versions):
MongoSK v2.1.0

Troubleshooting:
Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
 
Status
Not open for further replies.