After upgrading to Couchbase 4.5 I have started getting this error “Expression must be a group key or aggregate (write
.timestamp
)”,“code”:4210}. I’m i doing something wrong here? here is my query
select max(timestamp) as lastDetect, count(timestamp) as detectCount from write where docType is not missing AND docType = 'DetectRecord' AND proximityUUID = $uuid AND major = $major AND minor = $minor AND timestamp BETWEEN $startTime AND $endTime ORDER BY timestamp desc limit 1;
Example document:
{ "id": "1234k", "docType": "DetectRecord", "proximityUUID": "12kdf", "major": "dkf", "minor": "ad", "timestamp": 1464954200000 }