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
over 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.
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!
N
Nate Peters
said
almost 7 years ago
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:
dow = dow;
var allFetchedAvail = [];
var availToday = [];
var dataStore = Kinvey.DataStore.collection('avail');
var stream = dataStore.find();
stream.subscribe(function onNext(avail) {
console.log('fetching');
allFetchedAvail.push(avail);
for (i = 0; i < avail.length; i++) {
if (avail[i].dayOfWeek !== dow) {
var employeeName = avail[i].user_id.name;
$('#name').append('<option val="' + employeeName + '">' + employeeName + '</option>');
}
// Does employee have partial day availabity
else if (avail[i].allDay === false) {
// var start = avail[i].start;
// var end = avail[i].end;
// console.log(start , end);
}
}
}, function onError(error) {
console.error(error);
}, function onComplete(entity) {
});
P
Pranav J
said
over 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.
Thanks,
Pranav
Kinvey
P
Pranav J
said
almost 7 years ago
Nate,
Can you let me know the kid of the HTML5 app that you are building?
Are there any errors you are facing while fetching the data? A screenshot of the same would help me to better understand the issue.
What version of the Kinvey SDK you are using?
Thanks,
Pranav
Kinvey Support
T
Tayger
said
over 5 years ago
I'm having the same problem, 1 year later (latest Kinvey release under Kinvey HTML ):
... 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.
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 PopularTayger
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!
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:
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
Pranav J
Thanks,
Pranav
Kinvey Support
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
-
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