As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
collectionAccess insert() not getting to callback()
D
Dave Ackerman
started a topic
over 9 years ago
This may be more of a Mongo problem rather than Kinvey issue, but it's interesting to say the least. Here's my code for a custom endpoint. Here's a gist:
The callback never gets fired because you are calling response.complete() immediately after the insert command. The insert command is asynchronous, so as soon as its invoked, the flow immediately continues. One of the effects of calling response.complete() is that all further callbacks are cancelled.
To structure this correctly, you would call response.complete() within the insert callback.
Dave Ackerman
https://gist.github.com/dmackerman/9788168#file-createkickstart-js-L70-L76
Highlighted lines are the issue. The docs get inserted properly, but the callback never fires. I need the callback to get access to IDs.
Any ideas?