All Questions
Tagged with insert-update node.js
25
questions
0
votes
1
answer
428
views
sequelize has many associations update
i am building resful api with node js and sequelize (mysql).
i have two models with (event) has many (users).
for creating event with models i am doing this :
add(req, res) {
return event.create(
...
1
vote
0
answers
167
views
Update and insert multiple documents in mongodb
I was trying to update and insert many input documents into mongodb.
I found many resources, but didn't get the optimal solution except bulkWrite.
My documents looks like below.
[
{
pId: &...
-1
votes
1
answer
1k
views
How to insert array of objects into MariaDB database
I have very simple table in my MariaDB - 3 columns:
DT as PK
Savings
kpd
I want to be able to insert big array of object at once in the table. Here is a piece of the data how looks:
[ { date: '...
0
votes
1
answer
957
views
Problems with "updateMany" and "$pull" on array properties
I have the following object in my mongodb:
{
"item": {
"id": "/Ed/6wigZ9LTLs2mPDWDzOFD/he0vbUEvQBl2Bga/T8=",
"status": {
"likes": [
...
1
vote
0
answers
116
views
Mongoose updateMany with an array of objects
i am currently having an issue with mongoose.
I am developing a network mapper app (yes I know, Nmap exists) and I am having this issue to save or update the hosts in the database.
Currently, I have ...
0
votes
1
answer
119
views
Using updateOne method to update an object field inside array - throws error "Cannot create field 'url' in element"
I have MongoDB database (with Mongoose) containing a collection of Products (among others), which looks like this:
[
{
name: 'Product A',
url: 'product-a',
category: 'accesory',
...
0
votes
1
answer
1k
views
How to update two tables using id from one table to another?
I am writing a Node JS script, what I want to use for updating 2 tables from a remote database. The script does the following so far:
It connects to the remote database, selects the new values since ...
0
votes
1
answer
25
views
How to update the details in an array on post in MongoDB?
Although its printing the 'success' in console but i am unable to see the changes after clicking on post update.
User.update( { email:req.user.email },
{ $set: {
"Addtasks.$[].topic":...
0
votes
1
answer
1k
views
how to insert a data to a cell of excel sheet from nodejs
I tried the below code for updating a data in a cell of excel sheet.
The json is getting updated but the cell of that excel sheet is not getting updated with the new value.
Should we do some write ...
0
votes
1
answer
676
views
How to insert a record if not existing and update if existing (upsert) using node js mysql?
This is my insert query and now I want it to modify it using UPSERT method to check whether the reocord is existing then update if not existing insert.Here is my insert part.
jsonObj = JSON.parse(...
1
vote
1
answer
919
views
CouchDB Update Handler: doc update/insert using Nano
I am storing some locale based data in the following format in the CouchDB.
{
"_id": "a62f81b5afad1857c2f6399db500c73b",
"_rev": "3-923e5ed468e0f617f09057035b41051a",
"type": "CAT",
"...
3
votes
1
answer
2k
views
How to insertMany and update duplicates in mongodb?
I have many orders I would like to insert in MongoDB, the orders are unique indexed by orderID.
I would like to insert all the orders and update order time if one of my order was exists in the ...
0
votes
1
answer
418
views
Node.js/Express: mongoose/mongoDB update document with req.body but avoid updating _id field?
I am currently trying to update a document based on some _id value. If found, I want to update evreything with req.body, except setting a new _id (I want to avoid, that client can update their _id). ...
0
votes
1
answer
918
views
mongoose: findOneAndUpdate find more complicated expression than _id
I want to find a document, that matches some calculated ID and then looks if the timestamp is younger than 15 minutes. If thats the case and a doc is found, I want to update the document with the req....
0
votes
2
answers
88
views
Insert record in mongoDB then update it - Node.Js
I am new to nodeJS and MongoDB
I want to add a record to the database on the javascript event of PageLoad, then during the visit of the user i add values to this object and then update it in the ...