View mongoose-find-foreach-create-newest,js
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
Carts.find({ user: req.params.user }, function (err, product) { | |
if (err) { | |
return res.send({ isFound: false }); | |
} | |
if (!product) { | |
return res.send({ isFound: false }); | |
} | |
product.forEach(element => { | |
element.orderid = req.params.smaorderid |
View mongoose-find-loop-create.js
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
Cats.find({ user: req.params.user }, function (err, product) { | |
if (err) { | |
return res.send({ isFound: false }); | |
} | |
if (!product) { | |
return res.send({ isFound: false }); | |
} | |
product.forEach(element => { | |
element.orderid = req.params.smaorderid |
View docx-processing.js
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
[...] | |
docx.init({ | |
ND_DEV_ID: "", // goto https://developers.nativedocuments.com/ to get a dev-id/dev-secret | |
ND_DEV_SECRET: "", // you can also set the credentials in the enviroment variables | |
ENVIRONMENT: "NODE", // required | |
LAZY_INIT: true // if set to false the WASM engine will be initialized right now, usefull pre-caching (like e.g. for AWS lambda) | |
}).catch(function (e) { | |
console.error(e); | |
}); |
View ebay-token-example.js
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 axios = require("axios"); | |
axios.request({ | |
url: "/identity/v1/oauth2/token", | |
method: "POST", | |
baseURL: "https://api.sandbox.ebay.com/", | |
auth: { | |
username: "", // eBay client id | |
password: "" // eBay client secret | |
}, |
View test.js
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
try { | |
axios.get("here-my-url") | |
.then(data => res.status(200).send(data)) | |
.catch(err => res.send(err)); | |
} catch(err) { | |
console.error("ERROR", err); | |
} |
View test.js
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
router.get('/brand/:smabrand', function(req, res) { | |
const smaquery = req.query; | |
// [..] | |
let getProductCount=async function(smaquery){ | |
let count= await Products.countDocuments(smaquery); | |
console.log(count) | |
if (count === 0) { | |
return res.send("Brand not found!"); |