couchbase_lite
couchbase_lite copied to clipboard
And Query is not working returning empty result.
Describe the bug When I do Query like select * from document where sth =sth and sth = sth it does not work
To Reproduce
Future<List<Map<String, dynamic>>> filter(
QueryBuilder.select([SelectResult.all()])
.from(CoreDB.instance.dbName)
.where(
Expression.property(property)
.equalTo(
Expression.string(equator),
)
.and(
Expression.property(andProperty).equalTo(
Expression.string(andEquator),
),
)
}
Expected behavior I expect that if I have a document that has for example table='users' name='richard murag' id=WDF to be returned by that Query This is How I would call it final ``` List<Map<String, dynamic>> product = await _databaseService.filter( equator: 'richard murag', property: 'name', and: true, andProperty: 'table', andEquator: 'users, );
- OS: [android 29 sdk]
- Version [couchbase_lite: ^2.7.1+6]
I need your help on this.
Try adding from(CoreDB.instance.dbName) to all the expressions.
Future<List<Map<String, dynamic>>> filter(
QueryBuilder.select([SelectResult.all()])
.from(CoreDB.instance.dbName)
.where(
Expression.property(property).from(CoreDB.instance.dbName)
.equalTo(
Expression.string(equator),
)
.and(
Expression.property(andProperty).from(CoreDB.instance.dbName).equalTo(
Expression.string(andEquator),
),
)
}