Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…ind function of adapter
  • Loading branch information...
commit 7d987ee2054166d011d714c962d81312ccabe630 1 parent b62874e
@ktkaushik authored
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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.