Fixing bug with non functional limit

This commit is contained in:
Fabian Stamm 2019-11-10 15:05:30 +01:00
parent 1f193fd5a1
commit 87985def82
7 changed files with 10 additions and 22 deletions

16
package-lock.json generated
View File

@ -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",

View File

@ -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",

View File

@ -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;

View File

@ -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");

View File

@ -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))

View File

@ -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) {

View File

@ -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();