@@ -63,8 +63,9 @@ var Collection = function(db, topology, dbName, name, pkFactory, options) {
6363 var internalHint = null ;
6464 var opts = options != null && ( 'object' === typeof options ) ? options : { } ;
6565 var slaveOk = options == null || options . slaveOk == null ? db . slaveOk : options . slaveOk ;
66- var serializeFunctions = options == null || options . serializeFunctions == null ? db . serializeFunctions : options . serializeFunctions ;
67- var raw = options == null || options . raw == null ? db . raw : options . raw ;
66+ var serializeFunctions = options == null || options . serializeFunctions == null ? db . s . options . serializeFunctions : options . serializeFunctions ;
67+ var raw = options == null || options . raw == null ? db . s . options . raw : options . raw ;
68+ var promoteLongs = options == null || options . raw == null ? db . s . options . promoteLongs : options . promoteLongs ;
6869 var readPreference = null ;
6970 var collectionHint = null ;
7071 var namespace = f ( "%s.%s" , dbName , name ) ;
@@ -106,12 +107,14 @@ var Collection = function(db, topology, dbName, name, pkFactory, options) {
106107 , namespace : namespace
107108 // Read preference
108109 , readPreference : readPreference
109- // Raw
110- , raw : raw
111110 // SlaveOK
112111 , slaveOk : slaveOk
113112 // Serialize functions
114113 , serializeFunctions : serializeFunctions
114+ // Raw
115+ , raw : raw
116+ // promoteLongs
117+ , promoteLongs : promoteLongs
115118 // internalHint
116119 , internalHint : internalHint
117120 // collectionHint
@@ -341,11 +344,14 @@ Collection.prototype.find = function() {
341344 newOptions . promiseLibrary = this . s . promiseLibrary ;
342345
343346 // Set raw if available at collection level
344- if ( newOptions . raw == null && this . s . raw ) newOptions . raw = this . s . raw ;
347+ if ( newOptions . raw == null && typeof this . s . raw == 'boolean' ) newOptions . raw = this . s . raw ;
348+ // Set promoteLongs if available at collection level
349+ if ( newOptions . promoteLongs == null && typeof this . s . promoteLongs == 'boolean' ) newOptions . promoteLongs = this . s . promoteLongs ;
345350
346351 // Sort options
347- if ( findCommand . sort )
352+ if ( findCommand . sort ) {
348353 findCommand . sort = formattedOrderClause ( findCommand . sort ) ;
354+ }
349355
350356 // Set the readConcern
351357 if ( this . s . readConcern ) {
0 commit comments