A lot of changes
This commit is contained in:
@ -2,7 +2,7 @@ import { Rules } from "./rules";
|
||||
import Settings from "../settings";
|
||||
import getLevelDB, { LevelDB, deleteLevelDB } from "../storage";
|
||||
import DocumentLock from "./lock";
|
||||
import Query from "./query";
|
||||
import { DocumentQuery, CollectionQuery, Query } from "./query";
|
||||
|
||||
export class DatabaseManager {
|
||||
static databases = new Map<string, Database>();
|
||||
@ -104,8 +104,13 @@ export class Database {
|
||||
}
|
||||
|
||||
|
||||
getQuery(path: string[], sender: string) {
|
||||
return new Query(this, path, sender);
|
||||
getQuery(path: string[], sender: string, type: "document" | "collection" | "any") {
|
||||
if (type === "document")
|
||||
return new DocumentQuery(this, path, sender);
|
||||
else if (type === "collection")
|
||||
return new CollectionQuery(this, path, sender);
|
||||
else
|
||||
return new Query(this, path, sender);
|
||||
}
|
||||
|
||||
async stop() {
|
||||
|
Reference in New Issue
Block a user