@@ -60,7 +60,7 @@ import { forEach } from '../util/obj';
6060
6161import { BsonBinaryData } from './bson_binary_data' ;
6262import { BsonObjectId } from './bson_object_Id' ;
63- import { BsonTimestampValue } from './bson_timestamp_value' ;
63+ import { BsonTimestamp } from './bson_timestamp_value' ;
6464import { maxKey , minKey } from './field_value_impl' ;
6565import { GeoPoint } from './geo_point' ;
6666import { Int32Value } from './int32_value' ;
@@ -112,11 +112,11 @@ export abstract class AbstractUserDataWriter {
112112 case TypeOrder . RegexValue :
113113 return this . convertToRegexValue ( value . mapValue ! ) ;
114114 case TypeOrder . BsonObjectIdValue :
115- return this . convertToBsonObjectIdValue ( value . mapValue ! ) ;
115+ return this . convertToBsonObjectId ( value . mapValue ! ) ;
116116 case TypeOrder . BsonBinaryValue :
117- return this . convertToBsonBinaryValue ( value . mapValue ! ) ;
117+ return this . convertToBsonBinaryData ( value . mapValue ! ) ;
118118 case TypeOrder . BsonTimestampValue :
119- return this . convertToBsonTimestampValue ( value . mapValue ! ) ;
119+ return this . convertToBsonTimestamp ( value . mapValue ! ) ;
120120 case TypeOrder . MaxKeyValue :
121121 return maxKey ( ) ;
122122 case TypeOrder . MinKeyValue :
@@ -160,13 +160,13 @@ export abstract class AbstractUserDataWriter {
160160 return new VectorValue ( values ) ;
161161 }
162162
163- private convertToBsonObjectIdValue ( mapValue : ProtoMapValue ) : BsonObjectId {
163+ private convertToBsonObjectId ( mapValue : ProtoMapValue ) : BsonObjectId {
164164 const oid =
165165 mapValue ! . fields ?. [ RESERVED_BSON_OBJECT_ID_KEY ] ?. stringValue ?? '' ;
166166 return new BsonObjectId ( oid ) ;
167167 }
168168
169- private convertToBsonBinaryValue ( mapValue : ProtoMapValue ) : BsonBinaryData {
169+ private convertToBsonBinaryData ( mapValue : ProtoMapValue ) : BsonBinaryData {
170170 const fields = mapValue ! . fields ?. [ RESERVED_BSON_BINARY_KEY ] ;
171171 const subtypeAndData = fields ?. bytesValue ;
172172 if ( ! subtypeAndData ) {
@@ -182,9 +182,7 @@ export abstract class AbstractUserDataWriter {
182182 return new BsonBinaryData ( Number ( subtype ) , data ) ;
183183 }
184184
185- private convertToBsonTimestampValue (
186- mapValue : ProtoMapValue
187- ) : BsonTimestampValue {
185+ private convertToBsonTimestamp ( mapValue : ProtoMapValue ) : BsonTimestamp {
188186 const fields = mapValue ! . fields ?. [ RESERVED_BSON_TIMESTAMP_KEY ] ;
189187 const seconds = Number (
190188 fields ?. mapValue ?. fields ?. [ RESERVED_BSON_TIMESTAMP_SECONDS_KEY ]
@@ -194,7 +192,7 @@ export abstract class AbstractUserDataWriter {
194192 fields ?. mapValue ?. fields ?. [ RESERVED_BSON_TIMESTAMP_INCREMENT_KEY ]
195193 ?. integerValue
196194 ) ;
197- return new BsonTimestampValue ( seconds , increment ) ;
195+ return new BsonTimestamp ( seconds , increment ) ;
198196 }
199197
200198 private convertToRegexValue ( mapValue : ProtoMapValue ) : RegexValue {
0 commit comments