forked from voxel51/fiftyone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
434cc0d
commit 59dce12
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
FiftyOne v0.6.5 revision | ||
| Copyright 2017-2020, Voxel51, Inc. | ||
| `voxel51.com <https://voxel51.com/>`_ | ||
| | ||
""" | ||
import pymongo as pm | ||
|
||
|
||
def up(db, dataset_name): | ||
match_d = {"name": dataset_name} | ||
dataset_dict = db.datasets.find_one(match_d) | ||
sample_coll = db[dataset_dict["sample_collection_name"]] | ||
sample_coll.update_many({}, {"$rename": {"media_type": "_media_type"}}) | ||
|
||
|
||
def down(db, dataset_name): | ||
match_d = {"name": dataset_name} | ||
dataset_dict = db.datasets.find_one(match_d) | ||
sample_coll = db[dataset_dict["sample_collection_name"]] | ||
sample_coll.update_many({}, {"$rename": {"_media_type": "media_type"}}) |