We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddd7420 commit 45a32e1Copy full SHA for 45a32e1
lib/adapter.js
@@ -300,15 +300,20 @@ module.exports = (function() {
300
if (err) return cb( handleQueryError(err) );
301
302
// Build model to return
303
- var autoInc = 'id';
+ var autoInc = null;
304
305
Object.keys(collection.definition).forEach(function(key) {
306
if(!collection.definition[key].hasOwnProperty('autoIncrement')) return;
307
autoInc = key;
308
});
309
-
+
310
var autoIncData = {};
311
- autoIncData[autoInc] = result.insertId;
312
+ if (autoInc) {
313
314
+ autoIncData[autoInc] = result.insertId;
315
316
+ }
317
318
var model = _.extend({}, data, autoIncData);
319
0 commit comments