Support add-on for integrating Blueprint applications with ember-data.
- Ember.js v4.4 or above
- Ember CLI v4.4 or above
- Node.js v14 or above
ember install ember-blueprint-data
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
primaryKeyas_id. - It only serializes attributes that have changed.
- It only serializes
belongsTorelationships that exist, and have changed. - It does not serialize attributes that have
serialize:falseas part of its attribute definition. - It normalizes the
queryRecordresponse by converting it from an array to a single value. - It extends the
StoreandRESTAdapterwith support for thesearch()action on a MongoDBResourceController.
Use the MongoDB mixin by importing it into a serializer, such as the application serializer, and applying it to the extended class.
// 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!