Skip to content

Commit 79848e4

Browse files
ensure schema key is set. Fixes balderdashy#83
1 parent 20467be commit 79848e4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/connections/register.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ module.exports.configure = function ( connections ) {
2626
if(!connection.identity) return cb(Errors.IdentityMissing);
2727
if(connections[connection.identity]) return cb(Errors.IdentityDuplicate);
2828

29+
// Always ensure the schema key is set to something. This should be remapped in the
30+
// .describe() method later on.
31+
Object.keys(collections).forEach(function(coll) {
32+
collections[coll].schema = collections[coll].definition;
33+
});
34+
2935
// Store the connection
3036
connections[connection.identity] = {
3137
config: connection,

0 commit comments

Comments
 (0)