NCT-skyouo / skyouo-s-music-bot

一個非常強大的 Discord 音樂機器人, 基於 discord.js 與 discord-ytdl-core
The Unlicense
25 stars 4 forks source link

Bump quickmongo from 2.0.7 to 4.0.0 #147

Closed dependabot[bot] closed 3 years ago

dependabot[bot] commented 3 years ago

Bumps quickmongo from 2.0.7 to 4.0.0.

Release notes

Sourced from quickmongo's releases.

v4.0.0

Updates

QuickMongo v4 is completely rewritten in TypeScript. v4 is completely different from what older versions looked like.

Breaking Changes

  • QuickMongo no longer exports Database, instead it is a collection
  • Removed methods like add, subtract, math, divide, multiply, keyArray, valueArray, import etc.
  • v4 only has 10 methods: has, get, set, delete, push, pull, drop, all, latency and export.
  • Implements the Fields logic, which is now required.
  • QuickMongo now works as a utility layer, adding key-value interface to existing mongodb collection
  • Dot notations are no longer parsed from the key, instead it needs to be supplied separately as a parameter.
  • Database states are no longer handled by QuickMongo.
  • v4 is strongly typed, providing better experience to TypeScript users.
  • It supports exporting the collection as raw json, in better form.
  • v4 does implement the old data structure of quick.db, i.e. { ID: string; data: any; } however, users must use Fields.

Basic Example

const { Collection: MongoCollection, MongoClient } = require("mongodb");
const { Collection, Fields } = require("quickmongo");

const mongo = new MongoClient("mongodb://localhost/quickmongo"); const schema = new Fields.ObjectField({ difficulty: new Fields.StringField(), items: new Fields.ArrayField(new Fields.StringField()), balance: new Fields.NumberField() });

mongo.connect() .then(() => { console.log("Connected to the database!"); doStuff(); });

async function doStuff() { const mongoCollection = mongo.db().collection("JSON");

const db = new Collection(mongoCollection, schema);

await db.set("userInfo", { difficulty: "Easy", items: [], balance: 0 }).then(console.log);
// -> { difficulty: 'Easy', items: [], balance: 0 }

await db.push("userInfo", "Sword", "items").then(console.log);
// -> { difficulty: 'Easy', items: ['Sword'], balance: 0 }

await db.add("userInfo", 500, "balance").then(console.log);
// -> { difficulty: 'Easy', items: ['Sword'], balance: 500 }

// Repeating previous examples:

</tr></table>

... (truncated)

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
dependabot[bot] commented 3 years ago

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.