cast rns date to int for storage

This commit is contained in:
Ari Lazier 2016-02-15 17:52:40 -08:00
parent f34958ebae
commit 8b41b0a6d0
1 changed files with 6 additions and 2 deletions

View File

@ -30,7 +30,7 @@ const TestObjectSchema = {
} }
} }
const numTestObjects = 2000; const numTestObjects = 5000;
const numBatchTestObjects = numTestObjects * 100; const numBatchTestObjects = numTestObjects * 100;
const numRepeats = 1; const numRepeats = 1;
const numQueryBuckets = 5; const numQueryBuckets = 5;
@ -171,6 +171,7 @@ class RNStoreTests extends Tests {
async insertions() { async insertions() {
for (var obj of this.testObjects(numTestObjects)) { for (var obj of this.testObjects(numTestObjects)) {
obj.date = obj.date.getTime();
await this.db.add(obj); await this.db.add(obj);
} }
return numTestObjects; return numTestObjects;
@ -178,6 +179,9 @@ class RNStoreTests extends Tests {
async batchInsert(objects) { async batchInsert(objects) {
await this.db.multiAdd(objects); await this.db.multiAdd(objects);
for (var obj of this.testObjects(numTestObjects)) {
obj.date = obj.date.getTime();
}
return objects.length; return objects.length;
} }
@ -188,7 +192,7 @@ class RNStoreTests extends Tests {
var obj = objects[i]; var obj = objects[i];
obj.int; obj.int;
obj.double; obj.double;
obj.date; new Date(obj.date);
obj.string; obj.string;
} }
return len; return len;