function selectApiByCondiction (condiction) { return Apis.findAll({ where: condiction, raw: true }) }
function _getChildren(node) { let options = { where: { parentIds: { $like: node.parentIds + node.nodeId + '-%'} } }; return Node.findAll(options).then((rows) => { return rows.map((r) => { return r.dataValues; }); }); }
var find_all=function (req,res,next) { Company.findAll().then(company => { res.json(company); }); }
test("loads several records", async () => { const User = await defineModel({ keys: {"1": "uDiMcWVNTuz//naQ88sOcN+E40CyBRGzGTT7OkoBS6M="} }); await User.create({email: "EMAIL1", secret: "SECRET1"}); await User.create({email: "EMAIL2", secret: "SECRET2"}); const users = await User.findAll(); assert.equal(users[0].email, "EMAIL1"); assert.equal(users[0].secret, "SECRET1"); assert.equal(users[1].email, "EMAIL2"); assert.equal(users[1].secret, "SECRET2"); });
router.get('/', (req, res) => { Dog.findAll().then((data) => { res.json(data); }); });
/* GET users listing. */ router.get('/', function(req, res) { sequelize.sync() .then(function() { return Users.findAll(); }) .then(function(users) { res.json(users); console.log(JSON.stringify(users)); }) });
static getAll() { return db.User.findAll({ attributes: ['id'].concat(PUBLIC_FIELDS) }) }
function _getNodes(nodeIds) { let options = { where: { nodeId: { $in: nodeIds } } }; return Node.findAll(options).then((rows) => { return rows.map((r) => { return r.dataValues; }); }); }
async function index(request, response) { const books = await Book.findAll({ attributes: ['title', 'author'], }); response.json({ books: books }); }
/** * Gets an array of Parcels by numeric shipment ID. * * @param {string} shipmentId */ function getParcelsByShipmentId(shipmentId) { return Parcel.findAll({ where: { shipment: shipmentId }}) .then(parcels => parcels.map(getPlainObject)); }
var find_all=function (req,res,next) { Note.findAll().then(note => { res.json(note); }); }
var find_all=function (req,res,next) { Candidate.findAll().then(candidate => { res.json(candidate); }); }
var find_all=function (req,res,next) { Contact.findAll().then(contact => { res.json(contact); }); }
var find_all=function (req,res,next) { Organization.findAll().then(organization => { res.json(organization); }); }