apostrophe-schemas
Advanced tools
Comparing version 0.5.54 to 0.5.55
11
index.js
@@ -751,2 +751,3 @@ /* jshint node:true */ | ||
} | ||
return async.eachSeries(joins, function(join, callback) { | ||
@@ -814,2 +815,8 @@ var arrays = join._arrays; | ||
// Allow options to the get() method to be | ||
// specified in the join configuration | ||
if (join.getOptions) { | ||
_.extend(options.getOptions, join.getOptions); | ||
} | ||
// Allow options to the getter to be specified in the schema, | ||
@@ -819,5 +826,3 @@ // notably editable: true | ||
return self.joinrs[join.type](req, join, options, _objects, callback); | ||
}, function(err) { | ||
return callback(err); | ||
}); | ||
}, callback); | ||
}; | ||
@@ -824,0 +829,0 @@ |
{ | ||
"version": "0.5.54", | ||
"version": "0.5.55", | ||
"name": "apostrophe-schemas", | ||
@@ -4,0 +4,0 @@ "description": "Schemas for easy editing of properties in Apostrophe objects", |
@@ -342,3 +342,3 @@ # apostrophe-schemas | ||
An alternative is to set `contextual` to `false` for such fields. This will keep them out of forms generated by `{{ schemaFields }}`, but will not prevent you from taking advantage of other features of schemas, such as CSV import. | ||
An alternative is to set `contextual` to `true` for such fields. This will keep them out of forms generated by `{{ schemaFields }}`, but will not prevent you from taking advantage of other features of schemas, such as CSV import. | ||
@@ -543,2 +543,21 @@ Either way, it is your responsibility to add an appropriate `aposArea` or `aposSingleton` call to the page, as you are most likely doing already. | ||
Another way to speed up joins is to limit the fields that are fetched in the join. You may pass options such as `fields` to the `get` method used to actually fetch the joined objects. Note that `apos.get` and everything derived from it, like `snippets.get`, will accept a `fields` option which is passed to MongoDB as the projection: | ||
```javascript | ||
'stories': { | ||
addFields: [ | ||
{ | ||
name: '_books', | ||
withType: 'book', | ||
label: 'Books', | ||
getOptions: { | ||
fields: { title: 1, slug: 1 } | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
If you are just linking to things, `{ title: 1, slug: 1 }` is a good projection to use. You can also include specific areas by name in this way. | ||
#### Reverse Many-To-Many Joins | ||
@@ -545,0 +564,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
107212
1455
994