backbone-db-mongodb
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -23,3 +23,3 @@ var _ = require('underscore'), | ||
function toMongoDoc(doc) { | ||
if (doc._id) { | ||
if (doc && doc._id) { | ||
if (typeof doc._id === "string" && doc._id.length === "24") { | ||
@@ -34,3 +34,3 @@ debug('converting _id to MongoID'); | ||
function fromMongoDoc(doc) { | ||
if (doc._id) { | ||
if (doc && doc._id) { | ||
if (typeof doc._id === "object" && doc._id.toString && doc._id.toString().length === "24") { | ||
@@ -37,0 +37,0 @@ debug('converting _id to MongoID'); |
{ | ||
"name": "backbone-db-mongodb", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "MongoDB driver for Backbone.Db", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
24977
12
682