While trying to run query of type :
select count(*) from zips where state = 'CA' || 1 = 2
the ADS displays error as
>[Error] Script lines: 110-110 ----------------------
Exception occurred during aggregation: exception: $where is not allowed inside of a $match aggregation expression
[Executed: 5/9/2013 10:36:38 AM] [Execution: 0ms]
whereas running the query as select * from zips where state = 'CA' || 1 = 2 runs just fine.
Could you please investigate why query of type select count(*) from zips where state = 'CA' || 1 = 2 is not supported for mongodb? (This type of query is supported in other RDBMS (i ve tried in mysql)). Thanks
select count(*) from zips where state = 'CA'
works, but select count(*) from zips where state = 'CA' || 1 = 2
returns an error.
WHERE filters that contain expressions (i.e. not just the field name) both in the left side and the right side are supported by the JDBC driver by using the $where operator. However, it seems that MongoDB doesn't allow such operator inside the $match operator (used as filter on queries involving Aggregation Framework).
I think there is no working MongoShell query equivalent for the MongoSQL statement above.
WHERE filters that contain expressions (i.e. not just the field name) both in the left side and the right side are supported by the JDBC driver by using the $where operator. However, it seems that MongoDB doesn't allow such operator inside the $match operator (used as filter on queries involving Aggregation Framework).
I think there is no working MongoShell query equivalent for the MongoSQL statement above.
Marking this closed as seemingly there's not tech feasible solution.
Marking this closed as seemingly there's not tech feasible solution.
The count(*) query was producing an error, but it now returns an incorrect count.
select count(*) from zips where state = 'CA' || 1 = 2
--> returns 29467 (the total number of documents in the "zips" collection)
select * from zips where state = 'CA' || 1 = 2
--> returns 1523 documents
The count(*) query was producing an error, but it now returns an incorrect count.
select count(*) from zips where state = 'CA' || 1 = 2
--> returns 29467 (the total number of documents in the "zips" collection)
select * from zips where state = 'CA' || 1 = 2
--> returns 1523 documents
Both queries now return the expected number of documents.
Both queries now return the expected number of documents.
Issue #8864 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 14.0.0-beta-76 (mongo-jdbc 1.2.6) |
No time estimate |
1 issue link |
is a duplicate of #8973
Issue #8973universally truth/false logics should be supported in the where calause of aggregate functions |
select count(*) from zips where state = 'CA'
works, butselect count(*) from zips where state = 'CA' || 1 = 2
returns an error.