Malcolm van Raalte
Posts: 0
Joined: Thu Mar 13, 2014 5:58 pm

Service Where Clause

According to:

http://docs.appery.io/documentation/b...

I can add a constraint to my list service. I have two collections:

Organizations
Initiatives

where Initiatives has a Pointer column to Organizations. The column is called "organization".

I've created a List service for Initiatives. I've manually added a "where" parameter to the Request parameters. When I specify a default value of:

{"organization" : {"name" : "test"}}

it correctly filters the list to only those Initiatives that belong to the "test" organization. However, when I go to Test and enter the same where string there it returns no results.

What could be causing the issue?

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

Service Where Clause

Hello,

You should use a query like this:
http://docs.appery.io/documentation/b...

Malcolm van Raalte
Posts: 0
Joined: Thu Mar 13, 2014 5:58 pm

Service Where Clause

Isn't that what I've done with: {"organization" : {"name" : "test"}}

?

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

Service Where Clause

Not. You are using the wrong type query:

{"subtask": {"collName":"todo", "_id":"5278ef66e4b01085e4b79482"}}

subtask - column name with type point,
todo - column name on which pointer refers,
"_id":"5278ef66e4b01085e4b79482" - corresponding filter.

So you should use query like this:
{"organization": {"collName":"Initiatives ", {"name" : "test"}}

Malcolm van Raalte
Posts: 0
Joined: Thu Mar 13, 2014 5:58 pm

Service Where Clause

Ah.

Just tried:
{ "organization.name" : "test" }
and that worked too.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Service Where Clause

Malcolm, have you managed with this?

Malcolm van Raalte
Posts: 0
Joined: Thu Mar 13, 2014 5:58 pm

Service Where Clause

Yes, the "dot notation" is working.

Return to “Issues”