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