We generate a very large (>16MB) document, and try to insert it via a bulk operation:
bulk = collection.initialize_unordered_bulk_op bulk.insert({ large doc }) bulk.execute
We expect the error message to be similar to the message when a regular insert() is passed too large a document:
BSON::InvalidDocument: Document is too large (17825822). This BSON document is limited to 4194304 bytes.
Instead, this is the error returned:
NoMethodError: undefined method `[]' for nil:NilClass