Skip to content
Advertisement

Tag: node.js

Search Algorithm Implementation using NodeJS + MongoDB(or SQL)

There is an application with search input that gives an opportunity to search for contacts by their information stored in database. For example, I can type 0972133122 Alan and my search engine must return all contacts whose firstname is Alan & whose numbers match 0972133122 string. Of course, I can just type Alan 0972, for instance, and there must be

How to condense returned rows of users with multiple roles

I’m trying to wrap my head around this logic, but simply having a tough time. While trying to keep the database normalized, users can have multiple roles (example shows 2, but could have more than 2, currently have 6 total roles), and I’d like to return data to make it easily viewed on a front end UI. Tables simplified: USERS

InfluxDB placeholder “Empty bound parameter”

I’m struggling to format a InfluxDB query using placeholders. Here I query with multiple placeholders. The values are defined in the placeholders object, as seen below, Once sent, an error 400 – error parsing query: empty bound parameter In the error I can see the GET request, where it appears that the Influx library has correctly formatted the placeholders under

Express-Postgres fails to apply array filter: error: operator does not exist: integer[] && text[]

The same query works on the terminal. But for some reason I’m getting an error: pg.query is unable to process the expression path && Array[$1] using this: https://www.postgresql.org/docs/9.2/functions-array.html Answer This should work: Why? Short answer: type resolution. Long answer: Concluding from the error message that comments.comment_id is of type integer. Forming an array from it with ARRAY[comment_id] produces an integer

SQLite table is only able to hold 1 row?

So, I have 2 tables, that I’ve added per the documentation, but something weird happens whenever I try to add a row to them. The data is written into the .db file, but whenever I query it, it only returns the first row. I can still update, and read these rows normally, but any data I write to them, just

How to show multiple tables list in MySql

How to show multiple table list in mysql I have a query that has two tables one for patients and the second one for patients who has tested for covid-19 I want to show all the patients either they tested or not If tested then show the result with his/her name It only showing the patients who has tested for

PostgreSQL: deadlock without a transaction

I have a route (in a node JS app) that inserts and updates some data in a PostgreSQL database (version 13). In pseudo-code, here are all queries that are done in sequential order: On some instances of the app without that much traffic that writes on their own table, I have many deadlocks. I don’t understand why since there is

Advertisement