Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 17, 2017

Conversation

daprahamian
Copy link
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