Improvements in collection storage. Breaks compatibility with previous versions!

This commit is contained in:
Fabian Stamm
2019-11-04 17:52:18 +01:00
parent 9f944549b6
commit aa2a846031
8 changed files with 131 additions and 56 deletions

View File

@ -54,12 +54,17 @@ export class Database {
private level = getLevelDB(this.name);
get data() {
return this.level;
return this.level.data;
}
get collections() {
return this.level.collection;
}
public rules: Rules;
public locks = new DocumentLock()
public collectionLocks = new DocumentLock()
public changes = new Map<string, Set<(change: Change) => void>>();
@ -89,8 +94,8 @@ export class Database {
}
async setRootKey(key: string) {
await Settings.setDatabaseAccessKey(this.name, key);
this.accesskey = key;
await Settings.setDatabaseRootKey(this.name, key);
this.rootkey = key;
}
async setPublicKey(key: string) {