sails-mongo
Advanced tools
Comparing version 0.10.3 to 0.10.4
@@ -379,3 +379,3 @@ /*--------------------------------------------------------------- | ||
join: function (connectionName, collectionName, criteria, cb) { | ||
// Ignore `select` from waterline core | ||
@@ -393,6 +393,2 @@ if (typeof criteria === 'object') { | ||
// parentResults: parentResults, | ||
// instructions: criteria.joins, | ||
instructions: criteria, | ||
@@ -399,0 +395,0 @@ parentCollection: collectionName, |
@@ -65,3 +65,3 @@ | ||
} | ||
// Catch errors from building query and return to the callback | ||
@@ -73,3 +73,3 @@ try { | ||
} | ||
var collection = this.connection.db.collection(self.identity); | ||
@@ -151,3 +151,3 @@ | ||
} | ||
// Catch errors build query and return to the callback | ||
@@ -206,3 +206,3 @@ try { | ||
query; | ||
// Ignore `select` from waterline core | ||
@@ -254,3 +254,3 @@ if (typeof criteria === 'object') { | ||
var query; | ||
// Ignore `select` from waterline core | ||
@@ -282,3 +282,3 @@ if (typeof criteria === 'object') { | ||
* Get name of primary key field for this collection | ||
* | ||
* | ||
* @return {String} | ||
@@ -288,7 +288,11 @@ * @api private | ||
Collection.prototype._getPK = function _getPK () { | ||
var self = this; | ||
var pk; | ||
// @clarorz, @particlebanana | ||
// does this look right to you fellas based on the current implementation? | ||
// ~Mike June 22, 2014 | ||
return 'id'; | ||
_.keys(this.schema).forEach(function(key) { | ||
if(self.schema[key].primaryKey) pk = key; | ||
}); | ||
if(!pk) pk = 'id'; | ||
return pk; | ||
}; | ||
@@ -295,0 +299,0 @@ |
{ | ||
"name": "sails-mongo", | ||
"version": "0.10.3", | ||
"version": "0.10.4", | ||
"description": "Mongo DB adapter for Sails.js", | ||
@@ -44,3 +44,3 @@ "main": "./lib/adapter.js", | ||
"waterline-errors": "~0.10.0", | ||
"waterline-cursor": "~0.0.4" | ||
"waterline-cursor": "~0.0.5" | ||
}, | ||
@@ -47,0 +47,0 @@ "devDependencies": { |
1788
62383
Updatedwaterline-cursor@~0.0.5