Skip to content

Commit

Permalink
chore: Use preferred collection method delete_one (#34214)
Browse files Browse the repository at this point in the history
`remove` method of Collection objects has been deprecated in favour
of either `delete_one` or `delete_many`.

This change will address 36 deprecation warnings that are generated from
test runs.

Co-authored-by: Lewis Kabui <[email protected]>
  • Loading branch information
lewisemm and lewisemm authored Feb 14, 2024
1 parent 4bd0981 commit 4ee11d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xmodule/modulestore/split_mongo/mongo_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def delete_course_index(self, course_key):
key_attr: getattr(course_key, key_attr)
for key_attr in ('org', 'course', 'run')
}
return self.course_index.remove(query)
return self.course_index.delete_one(query)

def get_definition(self, key, course_context=None):
"""
Expand Down

0 comments on commit 4ee11d3

Please sign in to comment.