Skip to content

Commit

Permalink
lib: ignore the query parameter apiKey when building the BSON object …
Browse files Browse the repository at this point in the history
…for ontology queries, #TASK-5571
  • Loading branch information
jtarraga committed Feb 1, 2024
1 parent 01d147a commit 0218f40
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public CellBaseIterator<OntologyTerm> iterator(OntologyQuery query) throws CellB
QueryOptions queryOptions = query.toQueryOptions();

MongoDBCollection mongoDBCollection = getCollectionByRelease(mongoDBCollectionByRelease, query.getDataRelease());
System.out.println("ontology mongodb adaptor: mongoDBCollection = " + mongoDBCollection.toString() + ", data release = "
+ query.getDataRelease());
MongoDBIterator<OntologyTerm> iterator = mongoDBCollection.iterator(null, bson, projection, CONVERTER, queryOptions);
return new CellBaseMongoDBIterator<>(iterator);
}
Expand Down Expand Up @@ -114,9 +116,15 @@ public Bson parseQuery(OntologyQuery query) {
try {
for (Map.Entry<String, Object> entry : query.toObjectMap().entrySet()) {
String dotNotationName = entry.getKey();
if (!"dataRelease".equals(dotNotationName)) {
Object value = entry.getValue();
createAndOrQuery(value, dotNotationName, QueryParam.Type.STRING, andBsonList);
switch (dotNotationName) {
case "dataRelease":
case "apiKey":
// Nothing to do
break;
default: {
Object value = entry.getValue();
createAndOrQuery(value, dotNotationName, QueryParam.Type.STRING, andBsonList);
}
}
}
} catch (IllegalAccessException e) {
Expand Down

0 comments on commit 0218f40

Please sign in to comment.