Questions tagged [findandmodify]
96 questions
0
votes
0 answers
Format only new text in email
I created a macro that will find all months of the year in an email and turn them red. However I only want that to apply to the current email and nothing else within the thread. I'm not sure the syntax I would need to add. Would it be to not check…
0
votes
1 answer
How do I replace text snippets with single words in comma seperated text column in Python Pandas Dataframe?
I would like to map the following values in a text column in a DataFrame like this:
To this:
I thought I could use a dictionary to map the text snippets to the single words. Here is my code that I've tried:
import pandas as pd
data = {"col": ['i…

angeliquelinde
- 61
- 8
0
votes
0 answers
MongoDb findOneAndUpdate() concurrency multiple consumers
I am new to mongodb and using a mongodb database collection for my simple queueing system. I want to be able to run multiple instances of my consumer. I am using the findOneAndUpdate() operation to pick up a job a pending job and mark it processing…

chit
- 11
- 2
0
votes
0 answers
Find and Replace by referencing another cell formula
I am trying to write a code that is like find and replace within formulas. Essentially, I have all these cells that reference other workbooks yet the same cells. I need a code that replaces the middle terms which begin after the first 18 characters…

ANBU
- 1
0
votes
2 answers
Script to copy contents of cell (in a2) and paste this into 1st empty (of text and formulas) cell on row 2
I am trying to write a script to copy contents of cell (in a2) and paste this into the 1st empty (of text and formulas) cell on row 2.
Ones that I have tried to copy and use are to do similar but finding the next row in a column.
I have also tried…

Ben C
- 49
- 6
0
votes
2 answers
Changing a text in multiple AEM pages at multiple locations
I have a website hosted on AEM. I want to change a text that is present in almost all pages (say I want to change my product name which is present in all pages) . How can i do it. It can either be a Groovy/Java code or an ondeploy script or anything…

Nikita Bansal
- 21
- 6
0
votes
0 answers
R - Using the output of compare_df() to update original data frame
I have 3 questions relating to the compare_df() function within the compareDF CRAN package.
I have two data frames with identical structures but different contents (this_week and last_week):
this_week
Week A B C
1 1 0 0 0
2 2 0…
0
votes
1 answer
Concurrent findAndModify on the same document
Say there are 2 active transactions A and B (both are active, thus not yet committed). First, A does findAndModify on a random document matching the predicate and keeps the transaction active. Now B does the same findAndModify and happens to land on…

IWishIWid
- 1
- 1
0
votes
0 answers
Pythonic way to change one field in nested entry in MongoDB
Since im fairly new to MongoDB (and databases in general), i wonder if this is the most pythonic way to modify one field in a nested entry. The field i want to change is stored in my collection "boards" like this:
_id: 270
checklist: {
…

mnikley
- 1,625
- 1
- 8
- 21
0
votes
1 answer
How to update MongoDB collection from aggregation results, set values within array
Using PyMongo, I'm inner joining MongoDB documents in one collection (refer_docs) with documents in another collection (test), and I want to find those documents in which the values from a field in each document of the join don't match, and I want…

Kaleb Coberly
- 420
- 1
- 4
- 19
0
votes
0 answers
mongoose findByIdAndUpdate - check field and modify it
I have the following code:
Something.findByIdAndUpdate(
req.query.id,
{ $inc: { available: -1 } },
{ new: true, useFindAndModify: false },
(err, book) => {
);
});
I want to update the available field only if it is greater than 0.…

Ovidiu Firescu
- 385
- 3
- 11
0
votes
0 answers
find a class object from List
I have a list in which objects gets added, modified and removed very frequently with asynchronous calls (Dart).
I don't want to update object by index to ensure that the target object is only modified.
I tried this
class Foo(){
prop1;
…
0
votes
0 answers
Update 1 or more array items in Mongodb document by Index
I am pretty new to mongodb and am trying to figure out some slightly more precise queries. This is on a node.js server.
I want to update an array within an existing document by 1 or more indexes. The mongodb docs really don't help a beginner with…

MikeyB
- 460
- 1
- 6
- 22
0
votes
1 answer
MongoDB $concatArrays in findAndModify
I'm wondering if $concatArrays in the update section of findAndModify will copy the source array, add the new elements to it and save the result to the target array or will it just append the new elements to the existing array without the mentioned…

wookie
- 179
- 2
- 14
0
votes
1 answer
Java code for modifying txt file contents will not function properly
I am pretty new to java and working on an elementary project, experimenting with txt files.
In this case, i have a txt file named "Activities" that contains a set of activities, each of which associated with an ID. The user then can decide wether to…

Prat
- 1