Questions tagged [jsdata]

JSData is a framework-agnostic, storage-agnostic, in-memory data store.

Inspired by Ember Data, JSData is a framework-agnostic, storage-agnostic, in-memory data store.

The official website of JSData is js-data.io. The source can be found on GitHub.

JSData's adapters handle communication with various storage layers, such as localStorage, Firebase, RethinkDB, or your RESTful backend.

JSData runs in the browser, communicating with storage layers such as localStorage, Firebase, your RESTful backend (HTTP adapter), etc.

JSData also runs in NodeJS, where adapters for MongoDB, Redis, RethinkDB, MySql/Postgres/SQLite, etc. are available.

JSData presents a uniform API for executing your typical CRUD operations against any storage layer for which an adapter is available. You can easily combine adapters for more complicated data management.

Useful links:

58 questions
0
votes
1 answer

jasmine test cases for services that return DS.defineResource Object

can someone help me in testing the below code. My function goes as follows function BiAlertsService(DS,companyUrlConfig) { return DS.defineResource({ name: 'bi-alerts', idAttribute: 'id', endpoint: companyUrlConfig.companyApi +…
rajesh
  • 1
  • 1
0
votes
1 answer

js-data dataStore.find() can't find cached results

I am calling dataStore.find() with the same parameters each time. The current adapter is the HttpAdapter. However, after the initial call, it does not seem to be able to find the data in the cache and makes a call to the API again. This is happening…
Moo
  • 3,369
  • 4
  • 22
  • 41
0
votes
1 answer

How to solve dependency conflict between js-data-angular and js-data-http

I'm currently working on a project, the project has 2 npm packages installed: js-data-http and js-data-angular. The problem is js-data-http requires js-data@>=3.0.0 and js-data-angular requires js-data@>=2.0.0 <3. I've looked through all versions…
ArthurG
  • 335
  • 2
  • 11
0
votes
2 answers

JSdata - Query to match all items in array (MongoDB '$all' keyword)

I'm using jsdata to create a local cache for an Angular 1.5 web application. I modelled my data with the according relations and everythings works fine. I'm struggeling with a query and I'm not even sure if this will work with js-data at all: Lets…
IgSm
  • 1
  • 1
0
votes
1 answer

Sending request body in JS data - RESTfull service

I wanted to send the request body as the JSON object to RESTful service REST API Call: GET http://localhost/api/v1/logsearch/query {'query': {'match_all': {}}} Here is my DS.defineResource return DS.defineResource({ basePath: '/api/v1', …
Kim
  • 315
  • 4
  • 7
  • 13
0
votes
0 answers

How to Deserialize null response in js-data

The find method in js-data-http appears to have a special case where if item is falsey then it will reject the promise, otherwise it returns item. My problem is that some falsey values (0, null, '') are valid responses from my API. For example if I…
Rob
  • 3,687
  • 2
  • 32
  • 40
0
votes
1 answer

JSData load relations without opts

When eagerly loading relations through a mapper, the opts argument is passed down to the loaded relations. This breaks the api in my case. For instance: storyMapper.findAll({ title: 'foobar' }, { with: ['user'] }); This results in two requests: GET…
altschuler
  • 3,694
  • 2
  • 28
  • 55
0
votes
1 answer

Store doesn't cache nested objects

v3.rc5 js-data-http rc.2 my API responds with a nested resource e.g /user responds with a nested profile. "profile" and "user" are two mappers with respective relations "user": { "id": 1, "name": "Peter", "profile": { "id": 5 …
toto11
  • 1,552
  • 1
  • 17
  • 18
0
votes
0 answers

nested id for `store.find` in js-data-firebase adapter

I am trying to write a nested query, that I think can look like this: store.find('logs/by_date', '2016-11-02/user%40example,com') .then(result => console.log(result)); Where the ID is not just an ID, but a nested location in Firebase. Is this…
filype
  • 8,034
  • 10
  • 40
  • 66
0
votes
1 answer

How can you create a nested, custom class-action on a JS-Data resource?

I have a JS-Data object which is nested (i.e. has a parent relation) (NB all code is coffeescript) Follow = DS.defineResource name: "follow" endpoint: "follows" relations: belongsTo: post: localField: "post" …
Peter Nixey
  • 16,187
  • 14
  • 79
  • 133
0
votes
1 answer

How to make JSData save an instance property to localStorage

How can I make JSData update a modified object that is saved to localStorage? The code below saves a Tree object with two apples saved to it in a container object. Now updating that container and saving it 'mixes in to the existing instances' as…
Raymundus
  • 2,173
  • 1
  • 20
  • 35
0
votes
1 answer

How would I handle saving child objects along with their parent object in JSData?

If I had an object DS.defineResource({ name : 'parent', relations : { hasMany : { child : { localField : 'children', foreignKey : 'parentId' } } …
end-user
  • 2,845
  • 6
  • 30
  • 56
0
votes
1 answer

JS-Data slow jasmine tests after inject

I am having a JS-Data resource in angularjs, and every time I call inject on it in a (Jasmine) test, the test slows down, taking up to 700ms. I am already doing an ejectAll() after each test. It is not doing any $http requests either, so I am out of…
Raymundus
  • 2,173
  • 1
  • 20
  • 35
0
votes
1 answer

How to get JSData DS#create() to persist to data store

From the code below, I would expect the console value to increase every time I run the save() function. However, the number does not update. So I'm not seeing any created values injected into the store on create. Budget =…
Meeker
  • 5,979
  • 2
  • 20
  • 38
0
votes
1 answer

How to persist data injected into DataStore in JSData

JSData DS#inject documentation states that: Injecting an item into the data store does not save it to the server. There is a way to persist resources injected into DataStore? Say, as example, that I modified multiple resources injecting them into…
endorama
  • 498
  • 7
  • 15