@@ -16,6 +16,7 @@ const AmpersandModel = require('ampersand-model');
1616const AmpersandCollection = require ( 'ampersand-rest-collection' ) ;
1717const { ReadPreference } = require ( 'mongodb' ) ;
1818const { parseConnectionString } = require ( 'mongodb/lib/core' ) ;
19+ const dataTypes = require ( './data-types' ) ;
1920const localPortGenerator = require ( './local-port-generator' ) ;
2021
2122/**
@@ -80,7 +81,7 @@ assign(props, {
8081 ns : { type : 'string' , default : undefined } ,
8182 isSrvRecord : { type : 'boolean' , default : false } ,
8283 hostname : { type : 'string' , default : 'localhost' } ,
83- port : { type : 'number ' , default : 27017 } ,
84+ port : { type : 'port ' , default : 27017 } ,
8485 hosts : {
8586 type : 'array' ,
8687 default : ( ) => [ { host : 'localhost' , port : 27017 } ]
@@ -370,11 +371,11 @@ assign(props, {
370371 /**
371372 * The SSH port of the remote host.
372373 */
373- sshTunnelPort : { type : 'number ' , default : 22 } ,
374+ sshTunnelPort : { type : 'port ' , default : 22 } ,
374375 /**
375376 * Bind the localhost endpoint of the SSH Tunnel to this port.
376377 */
377- sshTunnelBindToLocalPort : { type : 'number ' , default : undefined } ,
378+ sshTunnelBindToLocalPort : { type : 'port ' , default : undefined } ,
378379 /**
379380 * The optional SSH username for the remote host.
380381 */
@@ -769,6 +770,7 @@ Connection = AmpersandModel.extend({
769770 props,
770771 derived,
771772 session,
773+ dataTypes,
772774 initialize ( attrs ) {
773775 if ( attrs ) {
774776 if ( typeof attrs === 'string' ) {
0 commit comments