cast rns date to int for storage
This commit is contained in:
parent
f34958ebae
commit
8b41b0a6d0
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue