mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-02-10 17:29:16 +00:00
store only id for number builds projection
This commit is contained in:
parent
c2db37b285
commit
ae860ad54e
6
db.js
6
db.js
@ -17,13 +17,13 @@ exports.init = function(dbPath, params, callback) {
|
||||
descCreateDate: descCreateDate,
|
||||
id: 1
|
||||
}},
|
||||
// note that's unordered projection (coz number is numeric)
|
||||
// TODO: pick only id as value for that rare used projection
|
||||
// note that's unordered projection (coz number is numeric),
|
||||
// it also contains only id
|
||||
{key: {
|
||||
projectName: pickProjectName,
|
||||
number: 1,
|
||||
id: 1
|
||||
}},
|
||||
}, value: pickId},
|
||||
{key: {
|
||||
projectName: pickProjectName,
|
||||
status: 1,
|
||||
|
@ -33,6 +33,7 @@ exports.init = function(params, callback) {
|
||||
exports._getPrevBuild = function(build, callback) {
|
||||
Steppy(
|
||||
function() {
|
||||
// get id of prev build
|
||||
db.builds.find({
|
||||
start: {
|
||||
projectName: build.project.name,
|
||||
@ -41,6 +42,10 @@ exports._getPrevBuild = function(build, callback) {
|
||||
limit: 1
|
||||
}, this.slot());
|
||||
},
|
||||
function(err, builds) {
|
||||
// get prev build by id
|
||||
db.builds.find({start: {id: builds[0].id}}, this.slot());
|
||||
},
|
||||
function(err, builds) {
|
||||
this.pass(builds[0]);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user