I noticed that .findOne on a Vector returns an array of one element which is different than .findOne on a Collection. I looked at it but couldn't determine why there was a difference.
I guess you'd want then both to return just the element. Here's a test that shows the problem.
/**
Test Collection data structure and methods.
*/
var vows = require('vows'),
assert = require('assert');
var Collection = require('../lib/gauss').Collection;
I noticed that .findOne on a Vector returns an array of one element which is different than .findOne on a Collection. I looked at it but couldn't determine why there was a difference. I guess you'd want then both to return just the element. Here's a test that shows the problem.
/**
var vows = require('vows'), assert = require('assert');
var Collection = require('../lib/gauss').Collection;
var Vector = require('../lib/gauss').Vector;
var collectionThings = new Collection( { type: 1, age: 1 }, { type: 2, age: 2 }, { type: 1, age: 3 }, { type: 2, age: 4 });
var vectorThings = new Vector( { type: 1, age: 1 }, { type: 2, age: 2 }, { type: 1, age: 3 }, { type: 2, age: 4 });
vows.describe('Collection vs Vector').addBatch({
},
},
},
} }).export(module);