1.0.4-fixed3 • Published 4 years ago

mongo-eco.js v1.0.4-fixed3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

This module is in beta, there will be bugs and many things wrong.

Install

$ npm install mongo-eco.js

Use

const MongoEco = require("mongo-eco.js")
const eco = new MongoEco({
connectTo: "mongodb://localhost/MyDBName",
urlParser: true,
unifiedTopology: true
})

//Or export

const MongoEco = require("mongo-eco.js")
const eco = new MongoEco({
connectTo: "mongodb://localhost/MyDBName",
urlParser: true,
unifiedTopology: true
})

module.exports = eco

Methods

  • setMoney
eco.setMoney({
user: "UserID",
guild: "GuildID",
money: 0
}) // returns the money of user
  • hasMoney
eco.hasMoney({
user: "UserID",
guild: "GuildID"
}) // returns true or false if the user has money
  • getMoney
eco.getMoney({
user: "UserID",
guild: "GuildID"
})
// returns the money of the user
  • updateMoney
eco.updateMoney({
user: "UserID",
guild: "GuildID"
}, {
money: 0,
bank: 0
}) // returns the info of user (mongodb findone)
  • subtractMoney
eco.subtractMoney({
user: "UserID",
guild: "GuildID"
}, {
money: 0
}) // returns the info of user (mongodb findone)
  • setMoneyBank
eco.setMoneyBank({
user: "UserID",
guild: "GuildID"
}, {
bank: 0
}) // returns the info of user (mongodb findone)
  • getMoneyBank
eco.getMoneyBank({
user: "UserID",
guild: "GuildID"
}) // returns the money of bank

Changelog

  • 26/08/2020

If there are connection or database errors, the module will say an error

1.0.4-fixed3

4 years ago

1.0.4-fixed2

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.4

4 years ago

1.0.4-fixed

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago