Questions tagged [massivejs]
26 questions
3
votes
3 answers
Run PostgreSQL UPDATE query for every object in array
Let's say I have a cart of grocery items and each item has a unique ID. When someone clicks "purchase", an array is sent with an object for each item in that cart. The cart varies so sometimes it might be 2 items and sometimes 6 items, etc.…

Cesar
- 59
- 7
3
votes
1 answer
How to multi-split a string (WHERE IN query)
I am passing a string as param (via massivejs) into my query. The string is formatted as: param = 'red, blue, green'. The param itself does not have a fixed length (',' being the delimiter) as it is populated through what the user sends in (but is…

Suman
- 43
- 5
2
votes
1 answer
massive.connectSync not a function
Why do I get this error, massive.connectSync is not a function when I run server.js. It works on my mac, but not my windows. Please help solve this enter code hereerror
var express = require("express");
var app = express();
var http =…

GoyaKing
- 99
- 7
1
vote
2 answers
translate the postgres ANY() operator into Node js using Massive library
I am trying to update an existing postgres query in the Nodejs code base.
Below is the existing query to select based on name
constructor(schema){
this.table = schema.employee_tb;
}
row = await this.table.findOne({ name });
Below is the Postgres…

Geezus
- 21
- 4
1
vote
0 answers
Massive.js selecting specific nested fields from document
I have the following document sturcture stored in a document table
{
firstname: '',
surname: '',
...
manager: {
firstname: '',
surname: ''
...
}
}
When selecting records with Massive.js i can limit the fields returned by…

ste2425
- 4,656
- 2
- 22
- 37
1
vote
0 answers
DeprecationWarning: Implicit disabling of certificate... How to fix? (node.js, express, massive)
I'm using Postgresql with Node.js, Express, and Massive. I'm getting this error:
"(node:11507) DeprecationWarning: Implicit disabling of certificate verification is deprecated and will be removed in pg 8. Specify rejectUnauthorized: true to require…

Page COW
- 515
- 13
- 31
1
vote
0 answers
PostgreSQL throws error "function count(integer) does not exist" with massivejs & node, but works with Postico
I'm working on a web app using React, Node, Express, Massive, and PostgreSQL, and having trouble performing one specific query:
SELECT
COUNT(DISTINCT cu.user_id) AS ucount,
COUNT(DISTINCT p.project_id) AS pcount,
COUNT(DISTINCT t.task_id)…

maurojflores
- 176
- 9
1
vote
1 answer
How to update column based on column name in postgres?
I've narrowed it down to two possibilities - DynamicSQL and using a case statement.
However, I've failed with both of these.
I simply don't understand dynamicSQL, and how I would use it in my case.
This is my attempt using case statements; one of…

Jay Sargent
- 17
- 7
1
vote
1 answer
Naming for 'id' column in massive.js
I have an existing table in which the primary key column is called gid instead of id. When I use a massive document query like the one below I get Error: column "id" does not exist. Can I specify that I have an id column named gid?
I am using the…

Sergi Mansilla
- 12,495
- 10
- 39
- 48
1
vote
1 answer
Using MassiveJS for REST put/post saves
Using current version of MassiveJS and express for API calls. When using the SAVE function, Massive wants a list of column names to update as follows:
router.put('/:id', function(req, res, next) {
db.suppliers.save(
{
id:…

CCPony
- 988
- 1
- 7
- 20
0
votes
0 answers
Error when using with Massive.js in Node.js
I've been using massive.js within node for a couple months now and never ran into this error. I am completely stumped. Here is the code I am working with:
require('dotenv').config()
const{CONNECTION_STRING, SERVER_PORT, SESSION_SECRET} =…

mnk802
- 75
- 6
0
votes
1 answer
PostgreSQL UNION, but where do the results come from?
I want to do a union with two tables, but I need to know where the results are coming from. Here is my join.
(SELECT * FROM watchlist_movies WHERE movie_id = $1 and user_id = $2)
UNION ALL
(SELECT* FROM favorite_movies WHERE movie_id = $1 and…

PPS
- 69
- 1
- 8
0
votes
1 answer
Is there a way to use massivejs and use dynamic variable for table name to create table and select table?
I have setup a postgreSQL access through a node server using express and massive, but I cannot find a way to build new tables with dynamic table names or select a table dynamically using massive. Any direction would be most appreciated!

SCA
- 1
- 1
0
votes
1 answer
Error when combining Express Router with Massive.js db call
When making an async/await call to database from an express router to postgres db via massive.js instance, the correct response from db is received, but the router apparently returns before async function finishes; therefore, the test invocation…

Kwhitejr
- 2,206
- 5
- 29
- 49
0
votes
1 answer
Multi user connection in massive.js
I wish to have connected more than 1 users at the same time, as follows:
const massive = require('massive');
massive({
host: 'localhost',
port: 5432,
database: 'appdb',
user: 'user_1',
password: 'pwd_1',
ssl: false,
…

SONewbiee
- 363
- 2
- 15