Skip to content

Commit

Permalink
Fix: convert _id value to ObjectId when value is string
Browse files Browse the repository at this point in the history
  • Loading branch information
welefen committed Feb 28, 2016
1 parent c672721 commit 6fcda87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/adapter/db/_parse_mongo.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default class extends think.base {
let result = {};
for(let key in where){
let value = where[key];
if(key === '_id'){
if(key === '_id' && think.isString(value)){
let validator = think.require('validator');
if(validator.mongoId(value)){
let {ObjectID} = think.require('mongodb');
Expand Down

0 comments on commit 6fcda87

Please sign in to comment.