Fix storage of GeoPoints in nested arrays/maps.

This commit is contained in:
Nikita Lutsenko
2016-02-03 20:06:22 -08:00
parent 3cd7f7dd73
commit 437e7726ed

View File

@@ -367,8 +367,11 @@ function transformAtom(atom, force, options) {
return new Date(atom.iso); return new Date(atom.iso);
} }
if (atom.__type == 'GeoPoint') { if (atom.__type == 'GeoPoint') {
if (!inArray && !inObject) {
return [atom.longitude, atom.latitude]; return [atom.longitude, atom.latitude];
} }
return atom;
}
if (atom.__type == 'Bytes') { if (atom.__type == 'Bytes') {
return new mongodb.Binary(new Buffer(atom.base64, 'base64')); return new mongodb.Binary(new Buffer(atom.base64, 'base64'));
} }