@@ -59,25 +59,25 @@ const REMOVE_OPTS_DEFAULTS = {}
59
59
*
60
60
* @example
61
61
* // Use Container instead of DataStore on the server
62
- * import {Container} from 'js-data'
63
- * import MongoDBAdapter from 'js-data-mongodb'
62
+ * import { Container } from 'js-data';
63
+ * import MongoDBAdapter from 'js-data-mongodb';
64
64
*
65
65
* // Create a store to hold your Mappers
66
66
* const store = new Container({
67
67
* mapperDefaults: {
68
68
* // MongoDB uses "_id" as the primary key
69
69
* idAttribute: '_id'
70
70
* }
71
- * })
71
+ * });
72
72
*
73
73
* // Create an instance of MongoDBAdapter with default settings
74
- * const adapter = new MongoDBAdapter()
74
+ * const adapter = new MongoDBAdapter();
75
75
*
76
76
* // Mappers in "store" will use the MongoDB adapter by default
77
- * store.registerAdapter('mongodb', adapter, { default: true })
77
+ * store.registerAdapter('mongodb', adapter, { default: true });
78
78
*
79
79
* // Create a Mapper that maps to a "user" collection
80
- * store.defineMapper('user')
80
+ * store.defineMapper('user');
81
81
*
82
82
* @class MongoDBAdapter
83
83
* @extends Adapter
@@ -991,8 +991,8 @@ Adapter.extend({
991
991
* Details of the current version of the `js-data-mongodb` module.
992
992
*
993
993
* @example
994
- * import {version} from 'js-data-mongodb'
995
- * console.log(version.full)
994
+ * import { version } from 'js-data-mongodb';
995
+ * console.log(version.full);
996
996
*
997
997
* @name module:js-data-mongodb.version
998
998
* @type {object }
@@ -1011,8 +1011,8 @@ export const version = '<%= version %>'
1011
1011
* {@link MongoDBAdapter } class.
1012
1012
*
1013
1013
* @example
1014
- * import {MongoDBAdapter} from 'js-data-mongodb'
1015
- * const adapter = new MongoDBAdapter()
1014
+ * import { MongoDBAdapter } from 'js-data-mongodb';
1015
+ * const adapter = new MongoDBAdapter();
1016
1016
*
1017
1017
* @name module:js-data-mongodb.MongoDBAdapter
1018
1018
* @see MongoDBAdapter
@@ -1023,61 +1023,61 @@ export const version = '<%= version %>'
1023
1023
* Registered as `js-data-mongodb` in NPM.
1024
1024
*
1025
1025
* @example <caption>Install from NPM</caption>
1026
- * npm i --save js-data-mongodb@rc js-data@rc mongodb bson
1026
+ * npm i --save js-data-mongodb js-data mongodb bson
1027
1027
*
1028
1028
* @example <caption>Load via CommonJS</caption>
1029
- * var MongoDBAdapter = require('js-data-mongodb').MongoDBAdapter
1030
- * var adapter = new MongoDBAdapter()
1029
+ * const MongoDBAdapter = require('js-data-mongodb').MongoDBAdapter;
1030
+ * const adapter = new MongoDBAdapter();
1031
1031
*
1032
1032
* @example <caption>Load via ES2015 Modules</caption>
1033
- * import {MongoDBAdapter} from 'js-data-mongodb'
1034
- * const adapter = new MongoDBAdapter()
1033
+ * import { MongoDBAdapter } from 'js-data-mongodb';
1034
+ * const adapter = new MongoDBAdapter();
1035
1035
*
1036
1036
* @module js-data-mongodb
1037
1037
*/
1038
1038
1039
- /**
1039
+ /**
1040
1040
* Create a subclass of this MongoDBAdapter:
1041
1041
* @example <caption>MongoDBAdapter.extend</caption>
1042
- * // Normally you would do: import { MongoDBAdapter } from 'js-data-mongodb'
1043
- * const JSDataMongoDB = require('js-data-mongodb')
1044
- * const { MongoDBAdapter } = JSDataMongoDB
1045
- * console.log('Using JSDataMongoDB v' + JSDataMongoDB.version.full)
1042
+ * // Normally you would do: import { MongoDBAdapter } from 'js-data-mongodb';
1043
+ * const JSDataMongoDB = require('js-data-mongodb');
1044
+ * const { MongoDBAdapter } = JSDataMongoDB;
1045
+ * console.log('Using JSDataMongoDB v' + JSDataMongoDB.version.full);
1046
1046
*
1047
1047
* // Extend the class using ES2015 class syntax.
1048
1048
* class CustomMongoDBAdapterClass extends MongoDBAdapter {
1049
- * foo () { return 'bar' }
1050
- * static beep () { return 'boop' }
1049
+ * foo () { return 'bar'; }
1050
+ * static beep () { return 'boop'; }
1051
1051
* }
1052
- * const customMongoDBAdapter = new CustomMongoDBAdapterClass()
1053
- * console.log(customMongoDBAdapter.foo())
1054
- * console.log(CustomMongoDBAdapterClass.beep())
1052
+ * const customMongoDBAdapter = new CustomMongoDBAdapterClass();
1053
+ * console.log(customMongoDBAdapter.foo());
1054
+ * console.log(CustomMongoDBAdapterClass.beep());
1055
1055
*
1056
1056
* // Extend the class using alternate method.
1057
1057
* const OtherMongoDBAdapterClass = MongoDBAdapter.extend({
1058
- * foo () { return 'bar' }
1058
+ * foo () { return 'bar'; }
1059
1059
* }, {
1060
- * beep () { return 'boop' }
1061
- * })
1062
- * const otherMongoDBAdapter = new OtherMongoDBAdapterClass()
1063
- * console.log(otherMongoDBAdapter.foo())
1064
- * console.log(OtherMongoDBAdapterClass.beep())
1060
+ * beep () { return 'boop'; }
1061
+ * });
1062
+ * const otherMongoDBAdapter = new OtherMongoDBAdapterClass();
1063
+ * console.log(otherMongoDBAdapter.foo());
1064
+ * console.log(OtherMongoDBAdapterClass.beep());
1065
1065
*
1066
1066
* // Extend the class, providing a custom constructor.
1067
1067
* function AnotherMongoDBAdapterClass () {
1068
- * MongoDBAdapter.call(this)
1069
- * this.created_at = new Date().getTime()
1068
+ * MongoDBAdapter.call(this);
1069
+ * this.created_at = new Date().getTime();
1070
1070
* }
1071
1071
* MongoDBAdapter.extend({
1072
1072
* constructor: AnotherMongoDBAdapterClass,
1073
- * foo () { return 'bar' }
1073
+ * foo () { return 'bar'; }
1074
1074
* }, {
1075
- * beep () { return 'boop' }
1076
- * })
1077
- * const anotherMongoDBAdapter = new AnotherMongoDBAdapterClass()
1078
- * console.log(anotherMongoDBAdapter.created_at)
1079
- * console.log(anotherMongoDBAdapter.foo())
1080
- * console.log(AnotherMongoDBAdapterClass.beep())
1075
+ * beep () { return 'boop'; }
1076
+ * });
1077
+ * const anotherMongoDBAdapter = new AnotherMongoDBAdapterClass();
1078
+ * console.log(anotherMongoDBAdapter.created_at);
1079
+ * console.log(anotherMongoDBAdapter.foo());
1080
+ * console.log(AnotherMongoDBAdapterClass.beep());
1081
1081
*
1082
1082
* @method MongoDBAdapter.extend
1083
1083
* @param {object } [props={}] Properties to add to the prototype of the
0 commit comments