Questions tagged [findandmodify]
96 questions
2
votes
1 answer
How to approach massive code structure conversion that changes SQL parameter passing?
I need to convert SQL with old way or inserting parameters into the query into a new way where parameters are replaced by question marks (?) and are passed separately to to the query handler - see examples of "old" and "new" below.
I have on the…

Dennis
- 7,907
- 11
- 65
- 115
2
votes
1 answer
MongoDB: Update an array using FindAndUpdate()
I have this code
{
"_id" : ObjectId("573308a2519d9ff8820e7be8"),
"id" : "Example",
"Test" : [
"InsertB1",
"InsertB2"
],
"num" : 2
}
I would like to use the function findAndUpdate because I would like to
Change…

Valerio Sansone
- 23
- 2
2
votes
1 answer
Atomicity of findAndModify on embedded documents
On mongodb manual there is an example for atomic operations on a single document.
book = {
_id: 123456789,
title: "MongoDB: The Definitive Guide",
available: 3,
checkout: [ { by: "joe", date:…

Emre Kenci
- 2,715
- 4
- 26
- 35
2
votes
1 answer
Mongodb findAndModify vs redis incr
I am wondering how good is Mongodb findAndmodify vs redis increment command in terms of speed. I know Mongodb findAndModify will do a r/w lock on the document but if I have 100 threads trying to simultaneously write was wondering if redis be a more…

Raghu Katti
- 63
- 1
- 5
2
votes
0 answers
Compare candidate password with bcrypt hash in Mongo
I want to make a Mongo FindAndModify request which finds a user by email and password and then updates it in one request, to be atomic. With basic MD5 hashed passwords and predefined salt I'd calculate hash before a request and make a following…

makados
- 149
- 1
- 3
- 11
1
vote
1 answer
Compare json data from 2 column with in schema and overwrite the latest data to main data in mongoos
I am trying to build a page from json data,
column "page_content" will have json and column "override_content" will have one or more parts of json with key.
"override_content" will always have the latest update, if column is null no override…

Warrior
- 3,184
- 12
- 44
- 53
1
vote
3 answers
Modify a specific setting in an INI file on multiple PCs using Windows Batch
My goal is to modify a single setting in an INI file over the network on multiple PC's using an external list of PCs, and output the results to a log file.
Needs to be a windows batch file. Network is locked out of running scripts such as…

Tricktech
- 15
- 5
1
vote
0 answers
Scala ReactiveMongo findAndUpdate placeholder for specific field
I am trying to use findAndUpdate in case of duplicate records when trying to insert to mongoDB, using scala and reactiveMongo.
The first function receives a document and performs a simple insert query, if it fails with code 11000 (the code for…

Gilad Tzemach
- 31
- 4
1
vote
1 answer
Find and replace string in folder name using command line
How can I replace a string in all my folder names in one directory. For example if I have these folders
hellojoe
hellomary
hellosusan
I want to change these to
worldjoe
worldmary
worldsusan

fractal5
- 2,034
- 4
- 29
- 50
1
vote
2 answers
Filemaker 18 - Change same field on multiple records at once
I'm a fairly inexperienced FM user and have tried searching for this answer but haven't had any luck.
I'm wondering if there's a simple way to change a parameter on multiple records at once. We're using a FMDB for shot tracking in film production.…

deepstructure
- 748
- 5
- 7
1
vote
1 answer
FindAndUpdate first 5 documents
I am looking to a way to FindAndModify not more than 5 documents in MongoDB.
This is collection for queue which will be processed from multiple workers, so I want to put it into single query.
While I cannot control amount of updates in UpdateOptions…

st78
- 8,028
- 11
- 49
- 68
1
vote
1 answer
How to add new object to existing data in mongo
I have a document like this on my table UserCollection:
{
"FirstName": "Mohammad",
"LastName": "Waheed",
}
I want to add another array object to it how can I do that.?
"PhoneNumbers":[ //this object is not present in the table
{
…

Mr world wide
- 4,696
- 7
- 43
- 97
1
vote
1 answer
Update whole child element of an array field of an document in mongodb nodejs
Considering the following document, i want to update whole field of dataset with _id:123,
"data": {
"_id": "1234546",
"dataset": [
{
"_id": "123",
"el2": "asd",
…

Lakshya Gupta
- 13
- 2
1
vote
1 answer
Find and replace with sequential numbers
I am trying to figure out how to perform a find and replace with sequential data. An example of the data:
Filename "voice/voice_001.ogg"
Filename "voice/voice_002.ogg"
I wish to 'move' by using find and replace to:
"voice/voice_001.ogg"…

famakki1
- 21
- 2
- 7
1
vote
2 answers
Python read config file regardless of sections
I'm a noob in Python
Problem: Find and replace Keys(strings) in files
For this I'm using Python ConfigParser. But I want to read the whole config (.ini) file into dictionary at once regardless of sections.
Is it possible?
Is it OK to do so?
I…

Ali
- 7,810
- 12
- 42
- 65