Created
February 6, 2019 17:27
-
-
Save vonvick/945dc8cdafb3264d80686e589e6c5b79 to your computer and use it in GitHub Desktop.
sequelize option property
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
// passing the model type to return the result as the instance of the model | |
currentMonthEarnings = await db.sequelize.query('SELECT SUM("priceEstimate") FROM "Orders" WHERE "assignedCarId" IN(:ids) AND "createdAt" < (:createdDate)', { | |
replacements: {ids: carIds, createdDate: currentDateMonth}, | |
model: db.Order, | |
mapToModel: true | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment