我在数据传输对象的类定义之下。我使用 spring-data-aerospike 来持久化。
import org.springframework.data.annotation.Id;
public class User implements Serializable {
@Id
String uid;
Map<String, Object> ext = new HashMap<String, Object>();
// getters & setters
}
数据库中的样本数据就像 -
select ext from department.User;
+-------+-------------------------+----------------------------------+
| PK | ext || @_class |
+-------+-------------------------+----------------------------------+
| "123" | MAP('{"idfa": "xyz"}') | "com.tut.dto.User" |
| "234" | MAP('{}') | "com.tut.dto.User" |
+-------+-------------------------+----------------------------------+
我现在需要查询数据库,因为它应该只返回在 ext 字段列中具有“idfa”键字符串的记录。
我尝试了以下。但它没有用
1.
select * from test.UserRecord where ext.idfa is not null;
Unsupported command format with token - '.'
Make sure string values are enclosed in quotes.
Type " aql --help " from console or simply "help" from within the aql-prompt.
```
2.
select * from test.UserRecord where ext contains 'idfa';
Unsupported command format with token - ''idfa''
Make sure string values are enclosed in quotes.
Type " aql --help " from console or simply "help" from within the aql-prompt.
How can I make it work?