Skip to content
Browse files

handling the case when there are no ids in the where options in the f…

…ind function of adapter
  • Loading branch information...
1 parent b62874e commit 7d987ee2054166d011d714c962d81312ccabe630 @ktkaushik committed Aug 8, 2013
Showing with 10 additions and 4 deletions.
  1. +10 −4 lib/adapter.js
View
14 lib/adapter.js
@@ -327,10 +327,16 @@ module.exports = (function() {
modelName = utils.capitalize( collectionName );
modelInstance = mongoose.models[ modelName ];
- if (options.where.id != 'create') {
- options.query = monUtils.covertIdForMongoose( options.where );
- }else {
- console.log(options.where);
+ console.log(options);
+
+ if (options.where) {
+ if (options.where.id != 'create') {
+ options.query = monUtils.covertIdForMongoose( options.where );
+ }else {
+ console.log(options.where);
+ options.query = options.where;
+ }
+ }else{
options.query = options.where;
}

0 comments on commit 7d987ee

Please sign in to comment.
Something went wrong with that request. Please try again.