@@ -10,9 +10,8 @@ var transform = require('./transform');
1010
1111// options can contain:
1212// collectionPrefix: the string to put in front of every collection name.
13- function ExportAdapter ( mongoURI , options ) {
13+ function ExportAdapter ( mongoURI , options = { } ) {
1414 this . mongoURI = mongoURI ;
15- options = options || { } ;
1615
1716 this . collectionPrefix = options . collectionPrefix ;
1817
@@ -63,8 +62,7 @@ function returnsTrue() {
6362// Returns a promise for a schema object.
6463// If we are provided a acceptor, then we run it on the schema.
6564// If the schema isn't accepted, we reload it at most once.
66- ExportAdapter . prototype . loadSchema = function ( acceptor ) {
67- acceptor = acceptor || returnsTrue ;
65+ ExportAdapter . prototype . loadSchema = function ( acceptor = returnsTrue ) {
6866
6967 if ( ! this . schemaPromise ) {
7068 this . schemaPromise = this . collection ( '_SCHEMA' ) . then ( ( coll ) => {
@@ -277,8 +275,7 @@ ExportAdapter.prototype.removeRelation = function(key, fromClassName,
277275// acl: a list of strings. If the object to be updated has an ACL,
278276// one of the provided strings must provide the caller with
279277// write permissions.
280- ExportAdapter . prototype . destroy = function ( className , query , options ) {
281- options = options || { } ;
278+ ExportAdapter . prototype . destroy = function ( className , query , options = { } ) {
282279 var isMaster = ! ( 'acl' in options ) ;
283280 var aclGroup = options . acl || [ ] ;
284281
@@ -346,8 +343,7 @@ ExportAdapter.prototype.create = function(className, object, options) {
346343// This should only be used for testing - use 'find' for normal code
347344// to avoid Mongo-format dependencies.
348345// Returns a promise that resolves to a list of items.
349- ExportAdapter . prototype . mongoFind = function ( className , query , options ) {
350- options = options || { } ;
346+ ExportAdapter . prototype . mongoFind = function ( className , query , options = { } ) {
351347 return this . collection ( className ) . then ( ( coll ) => {
352348 return coll . find ( query , options ) . toArray ( ) ;
353349 } ) ;
@@ -503,8 +499,7 @@ ExportAdapter.prototype.smartFind = function(coll, where, options) {
503499// TODO: make userIds not needed here. The db adapter shouldn't know
504500// anything about users, ideally. Then, improve the format of the ACL
505501// arg to work like the others.
506- ExportAdapter . prototype . find = function ( className , query , options ) {
507- options = options || { } ;
502+ ExportAdapter . prototype . find = function ( className , query , options = { } ) {
508503 var mongoOptions = { } ;
509504 if ( options . skip ) {
510505 mongoOptions . skip = options . skip ;
0 commit comments