The code below should create a collection: 'base_collectionName' in the database associated with zone 'foo-bar'.
let entity = seneca.make('foo-bar', 'base', 'collectionName')
entity.save$()
Unfortunately, the method parsecanon() in make_entity.js is handling it with a regular expression considering '-' as the empty value of one part of the canon. So the canon which should be
I recommend to change the regular expression used in parsecanon as follow to workaround this issue:
...
var m = /\$?(((?:\w|-)+|-)\/)?((\w+|-)\/)?(\w+|-)/.exec(str)
if (m) {
var zi = m[4] == null ? 4 : 2
var bi = m[4] == null ? 2 : 4
...
By the way, the acceptable character set per zone/base/name are dependent of the underlying database.
So I would recommend to make the different part of the regular expression customizable in order to simplify the integration of seneca-entity on existing databases.
The code below should create a collection: 'base_collectionName' in the database associated with zone 'foo-bar'.
Unfortunately, the method parsecanon() in make_entity.js is handling it with a regular expression considering '-' as the empty value of one part of the canon. So the canon which should be
is not parsed like that and produces
I recommend to change the regular expression used in parsecanon as follow to workaround this issue:
By the way, the acceptable character set per zone/base/name are dependent of the underlying database. So I would recommend to make the different part of the regular expression customizable in order to simplify the integration of seneca-entity on existing databases.