EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

GET query and PUT query on one page !

Hi there,

I need your lights !

I hv one page with twice the same query service (same DB, same table):
. first I use the query onload to open the right record set (row) = GET,
. then, I use that same query service for an update of that record set via "operations" = PUT.

when I set PUT, it changes in the 2 queries which have different names.
the first query is not GET anymore but PUT.

any advice on how I can solve that issue ?

thks a lot in advance,
best,

Eric

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

GET query and PUT query on one page !

Hello Eric,

It is better to create 2 different services with different methods (put, and get):
http://devcenter.appery.io/documentat...

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

GET query and PUT query on one page !

Hi Evgene,

1/ Thks for your note. That's what I needed !

2/ One thing strange ... :
2.1/ I set up the service as PUT,
2.2/ when testing (using the Test tab) that servicet does work with a "successful test" result and my record set is updated as expected,
2.3/ however, when coding the "where" and "operations" parameters, and invoking that service, nothing happens.
I checked from several angles but cldn't find the issue:
. it does invoke the service,
. it does read the code (inserted alert()),
. the code itself (field names, ... syntax, ...) looks fine,
2.4/ but no change in my record set.
any clue where it could mess up ?

I'm sharing the App o2o4pw with your support. if anybody cld hv a look, it wld be very kind, thk you !

3/ in addition, when it would work, I need to update 2 fields at once, do you have the syntax for a {"$set": ... a ... , ... b ... } ?
if not possible at once, I'll run a 2nd PUT service (I know how to setup that stuff now :) )

thks in advance

Eric

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

GET query and PUT query on one page !

Eric,

The fact is that you may update only one entry in the database at a time (http://devcenter.appery.io/documentat...). Accordingly, where will not work as you expect.

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

GET query and PUT query on one page !

Hi, thks for your prompt feedback.
I do understand your point (cannot update several records at once) but that's not my issue.
I do want to work on one record set ( = entry) at a time.
for that, my "where" points onto the record set's "_id" field (which is unique).
I do make the "where" works when testing the service, as well as the "operations".
however, once the "where" and "operations" JS codes set for the invoking mapping, nothing happens :-(
it cld be the codes but again I checked and nothing looks wrong.
cannot find out.
best,
Eric

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

GET query and PUT query on one page !

Eric,

You can update multiple records at a time using operations and where
Please look here to find more information about how to use operations: https://getsatisfaction.com/apperyio/...

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

GET query and PUT query on one page !

Dear Evgene, thks for your time,
this is neither my issue nor my question.
what I am facing is :
. "where" and "operations" work fine when testing, meaning:
. "test successful",
. the record is properly updated in the table.
. however, when mapping with adding JS code, the record is not updated.
It cld come from the code itself but it's quite simple instructions and I don't see any wrong thing.

this app is shared with your colleagues at a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a,
may I ask you guys to hv a quick look, it might be a mere parameter missing somewhere ?
thk you very much in advance,
Eric

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

GET query and PUT query on one page !

Hi - We will take a look, please specify your app name.

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

GET query and PUT query on one page !

thks
my app name is o2o4pw.
pls use the "version for Support to check query".
1/ home: challenge button
2/ real time game
3/ game list
4/ top game dd 08/20
5/ add my name as player2
from there it doesn t change the record in the table

thk u in advance
eric

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

GET query and PUT query on one page !

hello, would you be kind enough to tell me if you have enough info to proceed ?
I am not too sure you can access easily to the specific version I made for you to check. if troublesome, pls advice what I shld do instead.
I'd like to hv your feedback, coz' several PUT requests to run and I'm stuck with this mapping which doesn't work still :-( thk you in advance. Eric

Return to “Issues”