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
7
votes
1 answer

Define js-data resource in TypeScript

Is it possible to create a js-data resource definition using a TypeScript class? What I would like in general is having full typing support on computed property and instance method definitions. What would be awesome is something like this: class…
Aides
  • 3,643
  • 5
  • 23
  • 39
7
votes
1 answer

Many-to-Many relational support in JSData

Is there any way to define a many-to-many relationship in JSData? For example, I have these 3 tables: entity entityFile file On the "entity", i want to have a relationship called "files" which does a join THROUGH entityFile.
Sean Lynch
  • 6,267
  • 2
  • 43
  • 45
4
votes
2 answers

How do I add properties to a js-data object that I don't want persisted?

I'm using js-data (and js-data-angular) in conjunction with sockets via sails.js. When a new item is created/updated via sockets I want to call attention to it in my ui. I'd like to add an "updated" property to the object, but don't want to…
davepreston
  • 1,260
  • 1
  • 10
  • 20
3
votes
1 answer

How do I configure JSData with cookie-based sessions and CSRF headers?

I need to set up my JSData configuration to pass along info for cookie-based session authentication, as well as CSRF headers.
jmq
  • 2,359
  • 18
  • 32
3
votes
1 answer

js-data.io as Vue.js store

I'd like to use js-data 3.0.1 as store for my Vue.js 2.4.2 SPA. Everything works like a charm, but unfortunately I can't make the reactive data bindings work. I've already tried vue-js-data, which seems to be broken. The following example doesn't…
phortx
  • 849
  • 5
  • 21
3
votes
1 answer

JS-Data error: attrs must contain the property specified by idAttribute - with hasMany relations

Here's the error: http://puu.sh/lXzja/f773fb6c9a.png The primary key for my user model is username. The primary key for my routes is the routename. My api returns jsons inside data:{} as per jsonapi.org specs. Thus the id attribute is not in the…
Naila N
  • 45
  • 4
2
votes
1 answer

Custom js-data formatter for moment dates

I'm working with JS-Data and I would love to figure out the best way to go about writing a validator / formatter potentially for the Schema to handle date strings as moment objects. It would be great if I could validate a date property as a moment…
Jordan
  • 2,393
  • 4
  • 30
  • 60
2
votes
0 answers

js-data observing data changes

I was trying js-data 3.0.0-rc.9. I have few doubts regarding event listeners for data changes and how to use it. Users JSON: { id: '', nested : { attr: '', attr2: ""}, arr : [{},{} ..], username :…
2
votes
1 answer

js-data v3- Keeping meta information in a paginated end point

I'm trying to deserialize a paginated end point. The return request for this end point looks like { count: number, next: string, previous: string, data: Array[Objects] } The issue I'm having when using js-data to do a findAll, it's…
user133688
  • 6,864
  • 3
  • 20
  • 36
2
votes
1 answer

Proper way of updating js-data relation objects

I have a linked list of objects of the same type: GET /cards.json [{ "id": 1, "lesserCardId": null, "greaterCardId": 2, }, { "id": 2, "lesserCardId": 1, "greaterCardId": 3 }, { "id": 3, "lesserCardId": 2, "greaterCardId":…
Vlad-HC
  • 4,359
  • 2
  • 20
  • 25
2
votes
1 answer

How do I import 400+ modules, and iterate over them in my angular-cli project?

I am about to have 400+ models for use with js-data in my angular2 (angular-cli) app. my project's structure is this: - src/ - app/ - services/ - pipes/ - ui/ - data/ - store.ts - models/ - model1.ts -…
NullVoxPopuli
  • 61,906
  • 73
  • 206
  • 352
2
votes
1 answer

Angular JS-Data loading data from local file

I have an ionic app using angular and JS-Data that when running on a mobile device should load data from downloaded JSON files. I am bundling the files with the app in the www folder and copying into the relevant storage folder depending on the…
Aine Poole
  • 59
  • 5
2
votes
1 answer

Unit testing promises in js-data-angular models

We use js-data and js-data-angular in our project. I have the following model: (function () { 'use strict'; angular.module('dash.models') .factory('Diagnosis', ['DS', function (DS) { function transform(resourcename, attrs, cb) { …
daniel0mullins
  • 1,937
  • 5
  • 21
  • 45
1
vote
1 answer

JS-Data v3.0 stop execution in lifecycle hook

I am using js-data v3.0 and i am trying to prevent store-injection of the record received from my API upon update if the record was changed while saving. In js-data v2.9 one could abort the lifecycle by calling a callback with an error as argument…
Raymundus
  • 2,173
  • 1
  • 20
  • 35
1
vote
1 answer

JSData `where` does not work with `dataStore.findAll()`

If I call dataStore.findAll(mapperName, params, opts) where params is { where: { cc: { '===': 'test' } }, } I expect the resulting query string to be ?cc=test. However, it seems to encode the whole object as the resulting query…
Moo
  • 3,369
  • 4
  • 22
  • 41
1
2 3 4