Skip to content

fix(GridFS): fix TypeError: doc.data.length is not a function - #1570

Merged
daprahamian merged 1 commit into
3.0.0from
fix/GridFS/typeError
Nov 17, 2017
Merged

fix(GridFS): fix TypeError: doc.data.length is not a function#1570
daprahamian merged 1 commit into
3.0.0from
fix/GridFS/typeError

Conversation

@daprahamian

Copy link
Copy Markdown
Contributor

This is a port of #1555 to 3.0.0 branch.
When using the promoteBuffers connect option, doc.data is already a node.js Buffer.
So trying to call length() like for BSON.Binary fails.
Fixed simply by checking Buffer.isBuffer(doc.data) type.

This is a port of #1555 to 3.0.0 branch.
When using the promoteBuffers connect option, `doc.data` is already a node.js Buffer.
So trying to call `length()` like for `BSON.Binary` fails.
Fixed simply by checking `Buffer.isBuffer(doc.data)` type.
@daprahamian
daprahamian merged commit 22a4628 into 3.0.0 Nov 17, 2017
@daprahamian
daprahamian deleted the fix/GridFS/typeError branch November 17, 2017 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants