#Import command

16 messages · Page 1 of 1 (latest)

ember vortex

Im trying to make a command that basically gives anyone points [if they have any pending points].

Im not sure how to go about this so help is appreciated.

Im using MongoDB for my database

full night

@ember vortex

ionic vapor

Plus you’re fetching Users in a loop too

ionic vapor
ember vortex
ionic vapor
ember vortex

@ionic vapor it's still returning an error
CastError: Cast to Number failed for value "[ '$pendingPointCount' ]" (type Array) at path "pointCount"

dont mind the "somthing"

It makes it easier to get stuff

ionic vapor
for(const doc of documents) {
    await schema.findOneAndUpdate(
      {
        something
      },
      {
          $inc: {
            pountcount: doc.pendingPointCount
          },
          $set: //set
      }
    )
}