Created
July 13, 2019 11:39
-
-
Save shipcake/40f9277fddc1fb7fe1df366b64f299c9 to your computer and use it in GitHub Desktop.
.find mongoose array in document not work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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