Fixing bug with non functional limit
This commit is contained in:
parent
1f193fd5a1
commit
87985def82
16
package-lock.json
generated
16
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hibas123/realtimedb",
|
||||
"version": "2.0.1-0",
|
||||
"version": "2.0.0-beta.4",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -225,12 +225,6 @@
|
||||
"@types/mime": "*"
|
||||
}
|
||||
},
|
||||
"@types/shortid": {
|
||||
"version": "0.0.29",
|
||||
"resolved": "https://registry.npmjs.org/@types/shortid/-/shortid-0.0.29.tgz",
|
||||
"integrity": "sha1-gJPuBBam4r8qpjOBCRFLP7/6Dps=",
|
||||
"dev": true
|
||||
},
|
||||
"@types/ws": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-6.0.3.tgz",
|
||||
@ -3290,14 +3284,6 @@
|
||||
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
|
||||
"dev": true
|
||||
},
|
||||
"shortid": {
|
||||
"version": "2.2.15",
|
||||
"resolved": "https://registry.npmjs.org/shortid/-/shortid-2.2.15.tgz",
|
||||
"integrity": "sha512-5EaCy2mx2Jgc/Fdn9uuDuNIIfWBpzY4XIlhoqtXF6qsf+/+SGZ+FxDdX/ZsMZiWupIWNqAEmiNY4RC+LSmCeOw==",
|
||||
"requires": {
|
||||
"nanoid": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||
|
@ -30,7 +30,6 @@
|
||||
"typescript": "^3.6.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@hibas123/logging": "^2.1.1",
|
||||
"@hibas123/nodelogging": "^2.1.1",
|
||||
"@hibas123/utils": "^2.1.1",
|
||||
"dotenv": "^8.2.0",
|
||||
|
@ -1,5 +1,6 @@
|
||||
import Logging from "@hibas123/nodelogging";
|
||||
import * as dotenv from "dotenv";
|
||||
import { LoggingTypes } from "@hibas123/logging";
|
||||
dotenv.config()
|
||||
|
||||
|
||||
@ -17,4 +18,8 @@ const config: IConfig = {
|
||||
dev: (process.env.DEV || "").toLowerCase() === "true"
|
||||
}
|
||||
|
||||
if (config.dev) {
|
||||
Logging.logLevel = LoggingTypes.Log;
|
||||
}
|
||||
|
||||
export default config;
|
@ -1,7 +1,7 @@
|
||||
import * as WebSocket from "ws";
|
||||
import { Server, IncomingMessage } from "http";
|
||||
import { DatabaseManager } from "./database/database";
|
||||
import Logging from "@hibas123/logging";
|
||||
import Logging from "@hibas123/nodelogging";
|
||||
import { Query, CollectionQuery, DocumentQuery } from "./database/query";
|
||||
import Session from "./database/session";
|
||||
import nanoid = require("nanoid");
|
||||
|
@ -440,13 +440,11 @@ export class CollectionQuery extends Query {
|
||||
|
||||
let data = decode(value);
|
||||
if (this.fitsWhere(data)) {
|
||||
Logging.debug("Found fitting")
|
||||
if (this.limit < 0 || value.length < this.limit) {
|
||||
if (this.limit < 0 || values.length < this.limit) {
|
||||
values.push({
|
||||
id,
|
||||
data
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
stream.end((err) => err ? no(err) : yes(values))
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as Handlebars from "handlebars";
|
||||
import { readFileSync } from "fs";
|
||||
import config from "../../config";
|
||||
import Logging from "@hibas123/logging";
|
||||
import Logging from "@hibas123/nodelogging";
|
||||
|
||||
|
||||
function checkCondition(v1, operator, v2) {
|
||||
|
@ -6,7 +6,7 @@ import { BadRequestError, NoPermissionError } from "../helper/errors";
|
||||
import { DatabaseManager } from "../../database/database";
|
||||
import { MP } from "../../database/query";
|
||||
import config from "../../config";
|
||||
import Logging from "@hibas123/logging";
|
||||
import Logging from "@hibas123/nodelogging";
|
||||
import { getView } from "../helper/hb";
|
||||
|
||||
const AdminRoute = new Router();
|
||||
|
Reference in New Issue
Block a user