Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
Jubilant_DB_Scripts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tarun.madamanchi
Jubilant_DB_Scripts
Commits
ddf1ca8f
You need to sign in or sign up before continuing.
Commit
ddf1ca8f
authored
Nov 15, 2022
by
tarun2512
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
used $set instead of update
parent
fb5544fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
5 deletions
+1
-5
db_script_for_location.py
db_script_for_location.py
+1
-5
No files found.
db_script_for_location.py
View file @
ddf1ca8f
...
@@ -17,9 +17,5 @@ for record in records:
...
@@ -17,9 +17,5 @@ for record in records:
for
record
in
data_list
:
for
record
in
data_list
:
query
=
{
"task_id"
:
record
[
'task_id'
]}
query
=
{
"task_id"
:
record
[
'task_id'
]}
task_instance_records
=
list
(
mydatabase
.
task_instances
.
find
(
query
))
task_instance_records
=
mydatabase
.
task_instances
.
find
(
query
,{
"$set"
:{
"task_creation_step.Location_1"
:
record
[
'Location_1'
]}})
for
task_instance_record
in
task_instance_records
:
if
'task_creation_step'
in
list
(
task_instance_record
.
keys
()):
task_instance_record
[
'task_creation_step'
]
.
update
({
"Location_1"
:
record
[
'Location_1'
]})
mydatabase
.
task_instances
.
update_one
(
query
,
task_instance_data
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment