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.
I am working on building a HTML5 app. I am getting both a GET request and OPTIONS request back when I am trying to do a simple fetch of a data store.
Best Answer
P
Pranav J
said
almost 5 years ago
Tayger,
The Cache mode is the default mode for the data store if a type is not explicitly set. Please check this link for more information.
You are getting 2 results because one is from the cache and the other one is from backend. When you are calling find() method, SDK fetches entities from both the cache and the backend. This is working as per the design. The completion handler block will be called twice.
#1 call: will return the cached data stored locally - Here you are getting empty array because what you are looking for is not present in the cache.
#2 call: will return the data retrieved from the network - Here you are getting an array with searched data because this is fetched from the backend.
Please take a look at different datastore types and select the one which is the most suitable for your usecase.
... var promise = Kinvey.User.login('<username>', '<password>') .then(function() { // Fetch games var dataStore = Kinvey.DataStore.collection('games');
// Define query var query = new Kinvey.Query(); query.equalTo('gameid', 12345);
The Cache mode is the default mode for the data store if a type is not explicitly set. Please check this link for more information.
You are getting 2 results because one is from the cache and the other one is from backend. When you are calling find() method, SDK fetches entities from both the cache and the backend. This is working as per the design. The completion handler block will be called twice.
#1 call: will return the cached data stored locally - Here you are getting empty array because what you are looking for is not present in the cache.
#2 call: will return the data retrieved from the network - Here you are getting an array with searched data because this is fetched from the backend.
Please take a look at different datastore types and select the one which is the most suitable for your usecase.
Thanks,
Pranav
Kinvey
T
Tayger
said
almost 5 years ago
Hi Pranav
Thank you a lot for this (and all other answers) I have posted, all very helpfull! I have tried many (big) cloud services so far and I can tell you: Kinvey offers the best easy-to-use and most flexible environment!
P
Pranav J
said
almost 5 years ago
Tayger,
Thank you for the kind words. I am glad to hear that you found my answers helpful. Let us know if you have any other questions regarding Kinvey.
Nate Peters
I am working on building a HTML5 app. I am getting both a GET request and OPTIONS request back when I am trying to do a simple fetch of a data store.
Tayger,
The
Cache
mode is the default mode for the data store if a type is not explicitly set. Please check this link for more information.You are getting 2 results because one is from the cache and the other one is from backend. When you are calling find() method, SDK f
etches entities from both the cache and the backend. This is working as per the design.
The completion handler block will be called twice.
Please take a look at different datastore types and select the one which is the most suitable for your usecase.
Thanks,
Pranav
Kinvey
1 person has this question
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstPranav J
Thanks,
Pranav
Kinvey Support
Nate Peters
1). PHP app
2). I am getting no errors back,-- just a option and get response
3). 3.3.1
Example of my fetch code:
Tayger
I'm having the same problem, 1 year later (latest Kinvey release under Kinvey HTML ):
Any idea why I got two return results?
1. empty array
2. array with searched data
Pranav J
Tayger,
The
Cache
mode is the default mode for the data store if a type is not explicitly set. Please check this link for more information.You are getting 2 results because one is from the cache and the other one is from backend. When you are calling find() method, SDK f
etches entities from both the cache and the backend. This is working as per the design.
The completion handler block will be called twice.
Please take a look at different datastore types and select the one which is the most suitable for your usecase.
Thanks,
Pranav
Kinvey
Tayger
Hi Pranav
Thank you a lot for this (and all other answers) I have posted, all very helpfull! I have tried many (big) cloud services so far and I can tell you: Kinvey offers the best easy-to-use and most flexible environment!
Pranav J
Tayger,
Thank you for the kind words. I am glad to hear that you found my answers helpful. Let us know if you have any other questions regarding Kinvey.
Thanks,
Pranav
Kinvey
-
How do I use Kinvey in my web app?
-
Is it safe to include keys/secrets in my client-side JavaScript app?
-
Why is the activeUser null even though I am logged in?
-
Login does not work even though credentials are valid.
-
Social login doesn’t work.
-
Appending objects to an Array (HTML5 - JS)
-
New to node.js - need bootstrap to downloadfiles from Kinvey
-
Problem with Aggregation/Grouping
-
Internal Server Error using Twitter Sign Up
-
Data Store
See all 315 topics