diff --git a/src/python/dm/common/mongodb/api/datasetMongoDbApi.py b/src/python/dm/common/mongodb/api/datasetMongoDbApi.py index 5aef5f6e9564a665e1bbb34afb8ad4b922d4835a..66a8aa34f92d54d28ce7e3b78f9b262c9a3a7d3e 100755 --- a/src/python/dm/common/mongodb/api/datasetMongoDbApi.py +++ b/src/python/dm/common/mongodb/api/datasetMongoDbApi.py @@ -81,7 +81,7 @@ class DatasetMongoDbApi(DmMongoDbApi): if not useExperimentName: del datasetDict['experimentName'] self.getLogger().debug('Converting dataset dict to regex patterns') - ignoreCase = kwargs.get(self.IGNORE_CASE_KEY, True) + ignoreCase = kwargs.get(self.REGEX_IGNORE_CASE_KEY, True) queryDict = self.convertStringsToRegex(datasetDict, ignoreCase) return self.fileMongoDbApi.getExperimentFiles(experimentName, queryDict, returnFieldDict) diff --git a/src/python/dm/common/mongodb/api/dmMongoDbApi.py b/src/python/dm/common/mongodb/api/dmMongoDbApi.py index 338ae1aa1a2a37935b94141a9899e6b173871b21..a76e37b4878dd5a4ec5144496ca248a9608c19d4 100755 --- a/src/python/dm/common/mongodb/api/dmMongoDbApi.py +++ b/src/python/dm/common/mongodb/api/dmMongoDbApi.py @@ -12,7 +12,8 @@ class DmMongoDbApi: """ Base Mongo DB API class. """ SYSTEM_KEY_LIST = ['_id'] - IGNORE_CASE_KEY = '_ignoreCase' + REGEX_IGNORE_KEY_LIST = ['_id'] + REGEX_IGNORE_CASE_KEY = '_ignoreCase' def __init__(self): self.logger = LoggingManager.getInstance().getLogger(self.__class__.__name__) @@ -80,7 +81,7 @@ class DmMongoDbApi: def convertStringsToRegex(cls, dict, ignoreCase=True): dict2 = copy.copy(dict) for (key,value) in dict2.items(): - if key in cls.SYSTEM_KEY_LIST: + if key in cls.REGEX_IGNORE_KEY_LIST: continue elif type(value) == types.StringType or type(value) == types.UnicodeType: cls.getLogger().debug('Converting to regex: %s for key %s' % (value,key)) diff --git a/src/python/dm/common/mongodb/api/fileMongoDbApi.py b/src/python/dm/common/mongodb/api/fileMongoDbApi.py index 6254b4e27fea8f6afa86082d05bfa8cac5d2b369..e0bdc3f72af6ee1da3f3c898bacfba67b31e52bb 100755 --- a/src/python/dm/common/mongodb/api/fileMongoDbApi.py +++ b/src/python/dm/common/mongodb/api/fileMongoDbApi.py @@ -28,7 +28,7 @@ class FileMongoDbApi(DmMongoDbApi): def getFiles(self, queryDict={}, returnFieldDict=FileCollection.ALL_FIELDS_DICT, **kwargs): queryDict2 = self.getMongoDict(queryDict) self.getLogger().debug('Converting query dict to regex patterns') - ignoreCase = kwargs.get(self.IGNORE_CASE_KEY, True) + ignoreCase = kwargs.get(self.REGEX_IGNORE_CASE_KEY, True) queryDict2 = self.convertStringsToRegex(queryDict2, ignoreCase) return self.listToDmObjects(self.fileCollection.findByQueryDict(queryDict2, returnFieldDict), FileMetadata)