View Aggregation third solution
db.collection.aggregate([ | |
{ | |
"$group": { | |
"_id": { | |
"date": { | |
$dateToString: { | |
format: "%Y-%m-%d", | |
date: "$time" | |
} | |
}, |
View Aggregation second solution
db.collection.aggregate([ | |
{ | |
"$project": { | |
"_id": 1, | |
"product": 1, | |
"time": { | |
"$dateToString": { | |
"format": "%Y-%m-%d", | |
"date": "$time" | |
} |
View Aggregation fourth solution
db.collection.aggregate([ | |
{ | |
"$group": { | |
"_id": { | |
"$dateToString": { | |
"format": "%Y-%m-%d", | |
"date": "$time" | |
} | |
}, | |
"count": { |
View Aggregation first solution
db.collection.aggregate([ | |
{ | |
"$project": { | |
"_id": 1, | |
"product": 1, | |
"day": { | |
"$dayOfMonth": "$time" | |
}, | |
"month": { | |
"$month": "$time" |
View Result
[ | |
{ | |
"_id": "2019-1-28", | |
"count": 2 | |
}, | |
{ | |
"_id": "2019-1-27", | |
"count": 1 | |
} | |
] |
View sales data
[ | |
{ | |
"time": ISODate("2019-01-28T15:57:41.269Z"), | |
"product": "MacBook Pro" | |
}, | |
{ | |
"time": ISODate("2019-01-28T15:57:41.269Z"), | |
"product": "iPhone 7" | |
}, | |
{ |
View index.js
app.inputs.search({ concept: { name: 'golden retriever' } }).then( | |
function (response) { | |
response.hits.forEach(hit => { | |
console.log(hit.score); | |
console.log(hit.input.data.image); | |
}); | |
}, | |
function (err) { | |
console.log(err); | |
} |
View index.js
app.models.train("golden retriever").then( | |
function (response) { | |
console.log(response.rawData); | |
}, | |
function (err) { | |
console.log(err); | |
} | |
); |
View index.js
app.models.create( | |
"golden retriever", | |
[ | |
{ "id": "golden retriever" } | |
] | |
).then( | |
function (response) { | |
console.log(response); | |
}, | |
function (err) { |
View index.js
app.inputs.create([ | |
{ | |
url: "https://www.pets4homes.co.uk/images/breeds/9/4a7da5efe7121c4e03c417c344306bd0.jpg", | |
concepts: [ | |
{ | |
id: "golden retriever", | |
value: true | |
} | |
] | |
}, |
NewerOlder