Questions tagged [javascript]

12 questions
5
votes
1 answer

Not authorized on test to execute command

Here is my code: mongoose.connect(consts.database, { useNewUrlParser: true, useUnifiedTopology: true, sslCA: consts.databaseCert, }); //... const user = await db.userModel.findOne({ username: usernameLowerCase }).exec(); Here is my…
now_world
  • 221
  • 1
  • 2
  • 6
1
vote
1 answer

Mongo Preventing access to dangerous command

Reading Mongo: Definite guide: In first chapter, author mentions the following snippet to change some of the default commands of db: var no = function() { print("Not on my watch."); }; // Prevent dropping databases db.dropDatabase =…
Cody
  • 123
  • 6
1
vote
0 answers

Converting Mongoose schema to Prisma Mysql schema

I am trying to convert the following Mongoose schema to a Prisma MySql Schema. Not sure if I am doing it right. Here is the Mongoose Schema: import mongoose from 'mongoose'; const { ObjectId } = mongoose.Schema; const CartSchema = new…
John John
  • 111
  • 1
  • 1
  • 4
1
vote
0 answers

Non RAM based in-browser database solutions?

I want to decentralize my databases and upload it to Sia Skynet to give the users the ability to search on front-end. It is important to be able to deal with large amounts of data, but the RAM-based in-browser SQL engines (MiniSearch, AlaSQL, etc)…
1
vote
1 answer

Trouble connecting to local MongoDB server through app.js

I'm a newbie to MongoDB, and I just set up MongoDB within my Ubuntu terminal with mongod and mongo commands running in separate terminals. However, I can't get my app.js that would launch a website to run properly. Here is the beginning of the…
mazuka487
  • 11
  • 1
  • 2
0
votes
1 answer

Is it really possible to use SQL injection to change a database, or is this a scam?

A guy I know at college is claiming he can change his grades by gaining access to the database through an SQL inject, and can also gain access to all admin account privileges and records. The portal is accessed through outlook account and he did a…
0
votes
1 answer

Can you run PL/Python or PL/v8 code from the database itself?

It it possible to run code that is stored in the database, on the database. For example, I'd like a trigger to execute a function whose Javascript code is stored in the same database. (Normally, functions are defined in advance.) Is this possible,…
fadedbee
  • 143
  • 1
  • 5
0
votes
0 answers

Generate report by cross join between two tables

I wanted to generate report between two tables by using CROSS JOIN. Below shows the details of table. Table 1: kod_jawatan jawatan_id jawatan_kod jawatan_nama Table 2:…
NAS BS
  • 1
  • 1
0
votes
1 answer

Best way for processing over 150 million rows MySql

I wrote a function on nodejs to SELECT 150 million records, process the data and UPDATE those same 150 million records using UPDATE 'table' SET value1='somevalue' WHERE idRo2 = 1; Single Update for each row concatenate send one single query string…
0
votes
1 answer

How to parse MongoDB int32 in node.js

I am using MongoDB for a discord bot I am working on, and I want to retrieve a user's balance. My current code is function findBalance(id){ MongoClient.connect(url, function(err, db) { if (err) throw err; var dbo = db.db("DiscordDB"); var query = {…
0
votes
1 answer

Migrating timezone timestamps

I am trying to migrate this node library https://github.com/LocalSEOGuide/lighthouse-reporter from Postgres to MySQL and getting an error error: ER_TRUNCATED_WRONG_VALUE: Incorrect datetime value: '2020-03-22T20:38:48.347Z' for column 'fetch_time'…
fotoflo
  • 101
  • 1
-1
votes
1 answer

How to get applied stored procedure for inserted row in mysql php query

$query = "CREATE PROCEDURE IF NOT EXISTS Insertion(IN firstname varchar(40),IN lastname varchar(40),IN email varchar(40),IN department varchar(40),IN doj date,IN basicpay int(11)) BEGIN DECLARE HRA decimal(20,2); DECLARE DA decimal(20,2); …