https://github.com/onehilltech/ember-blueprint-data
https://github.com/onehilltech/ember-blueprint-data
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/onehilltech/ember-blueprint-data
- Owner: onehilltech
- License: mit
- Created: 2018-11-22T03:53:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-27T12:54:15.000Z (about 2 years ago)
- Last Synced: 2025-03-28T17:47:19.422Z (over 1 year ago)
- Language: JavaScript
- Size: 2.74 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ember-blueprint-data
Support add-on for integrating Blueprint applications with ember-data.
## Compatibility
* Ember.js v4.4 or above
* Ember CLI v4.4 or above
* Node.js v14 or above
## Installation
ember install ember-blueprint-data
MongoDB Support
------------------------------------------------------------------------------
The addon provides a mixin for `DS.RESTSerializer` that provides baseline behavior
for integrating with `blueprint-mongodb`. More specifially, the MongoDB mixin
provides the following functionality:
* It defines the `primaryKey` as `_id`.
* It only serializes attributes that have changed.
* It only serializes `belongsTo` relationships that exist, and have changed.
* It does not serialize attributes that have `serialize:false` as part of its attribute definition.
* It normalizes the `queryRecord` response by converting it from an array to a single value.
* It extends the `Store` and `RESTAdapter` with support for the `search()` action on a MongoDB `ResourceController`.
Use the MongoDB mixin by importing it into a serializer, such as the application
serializer, and applying it to the extended class.
```javascript
// app/serializers/application.js
import DS from 'ember-data';
import MongoDB from 'ember-blueprint-data/mixins/serializers/mongodb'
export default DS.RESTSerializer.extend (MongoDB, {
});
```
Happy Coding!