I have a table called visitDetails, which I'm querying as follows,
realm
.objects("visitDetails")
.filtered("visitDate='"+new Date(response.date)+"' AND chemistId='"+response.chemist_id+"'");
I have saved the visitDate as date objects before, so I'm also querying by date objects. I'm however, getting as error saying,
Error: You must pass in a date argument to pare
But I'm already passing in a date argument...
new Date( response.date )
, where response.date is in milliseconds.
I have a table called visitDetails, which I'm querying as follows,
realm
.objects("visitDetails")
.filtered("visitDate='"+new Date(response.date)+"' AND chemistId='"+response.chemist_id+"'");
I have saved the visitDate as date objects before, so I'm also querying by date objects. I'm however, getting as error saying,
Error: You must pass in a date argument to pare
But I'm already passing in a date argument...
new Date( response.date )
, where response.date is in milliseconds.
Share Improve this question asked Aug 3, 2017 at 6:17 Abhishek AcharyaAbhishek Acharya 3294 silver badges13 bronze badges 1- Abhishek what can you tell me how did you save the date in the realm. The property is date type right? and in which format did you save? – Omer Commented Dec 17, 2017 at 12:27
2 Answers
Reset to default 6Right now you are casting the Date
object to a string by concatenate it with a string.
You should do something like this
realm.objects('visitDetails').filtered(
"visitDate = $0 AND chemistId = $1",
new Date(response.date),
response.chemist_id
);
Quick solution here. You should pass date as parameter.
.filtered("visitDate = $0 AND chemistId = $1", new Date(response.date), response.chemist_id);
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742359378a4429084.html
评论列表(0条)