Skip to content

Instantly share code, notes, and snippets.

@shipcake
Created July 13, 2019 11:39
Show Gist options
  • Save shipcake/40f9277fddc1fb7fe1df366b64f299c9 to your computer and use it in GitHub Desktop.
Save shipcake/40f9277fddc1fb7fe1df366b64f299c9 to your computer and use it in GitHub Desktop.
.find mongoose array in document not work
const { products } = require('../../../../mongo/model') //import categories mongo model
const show_products = async(_,{offset,limit},ctx) => {
console.log('offset'+offset)
console.log('limit'+limit)
const res = await products.find({"storeuid":ctx.token.storeuid},null,{skip:offset,limit:limit})
console.log(res) //return all object in array
return res
}
module.exports={show_products}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment