Coder Social home page Coder Social logo

screepsmod-stats's People

Contributors

alinanova21 avatar esryok avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

nhanho

screepsmod-stats's Issues

Error: Query must be an object

With screepsmod-mongo I am receiving the following error:

DBERR MongoError: query selector must be an object
    at Function.MongoError.create (/screeps/mods/node_modules/mongodb-core/lib/error.js:31:11)
    at Collection.find (/screeps/mods/node_modules/mongodb/lib/collection.js:313:22)
    at findOne (/screeps/mods/node_modules/mongodb/lib/collection.js:1413:26)
    at /screeps/mods/node_modules/mongodb/lib/collection.js:1405:5
    at Promise (<anonymous>)
    at Collection.findOne (/screeps/mods/node_modules/mongodb/lib/collection.js:1404:10)
    at Object.wrap.(anonymous function).a [as findOne] (/screeps/mods/node_modules/screepsmod-mongo/lib/common/_connect.js:69:47)
    at Array.updateLeaderboardSeason (/screeps/mods/node_modules/screepsmod-stats/lib/mod.js:212:54)
    at _.forEach (/app/node_modules/@screeps/backend/lib/cronjobs.js:28:17)
    at /app/node_modules/lodash/index.js:3073:15
    at baseForOwn (/app/node_modules/lodash/index.js:2046:14)
    at /app/node_modules/lodash/index.js:3043:18
    at Function.<anonymous> (/app/node_modules/lodash/index.js:3346:13)
    at Timeout.module.exports.run [as _onTimeout] (/app/node_modules/@screeps/backend/lib/cronjobs.js:24:7)
    at ontimeout (timers.js:469:11)
    at tryOnTimeout (timers.js:304:5)
    at Timer.listOnTimeout (timers.js:264:5)

this seems to be caused by this line which is using findOne(id) rather than the correct findOne({ _id: id })

return storage.db["leaderboard.seasons"].findOne(id).then(result => {

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.