Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Another Windows tool nl. MongoVue also looks for <em>filename</em> instead of <em>fileName</em>. I'd say the answer is more likely filename instead of fileName. </p> <hr> <p>With retrieving the small Windows file from GridStore, I found a bug, but I don't know how to fix it. I guess there must be some value like Chunk.CurrentSize or the like, but looking at the chunk.js file in the native node mongo driver <a href="https://github.com/mongodb/node-mongodb-native/blob/master/lib/mongodb/gridfs/chunk.js" rel="nofollow">https://github.com/mongodb/node-mongodb-native/blob/master/lib/mongodb/gridfs/chunk.js</a>, I did the following...</p> <p>I found this:</p> <pre><code>Chunk.prototype.readSlice = function(length) { if ((this.length() - this.internalPosition + 1) &gt;= length) { var data = null; if (this.data.buffer != null) { //Pure BSON data = this.data.buffer.slice(this.internalPosition, this.internalPosition + length); } else { //Native BSON data = new Buffer(length); length = this.data.readInto(data, this.internalPosition); } this.internalPosition = this.internalPosition + length; return data; } else { return null; } }; </code></pre> <p>and moved the following </p> <pre><code>data = this.data.buffer.slice(this.internalPosition, this.internalPosition + length); </code></pre> <p>into the this if statement (1024 * 256 is the value from Chunk.DEFAULT_CHUNK_SIZE = 1024 * 256;)</p> <pre><code> if (this.data.buffer != null) { //Pure BSON if (this.data.buffer.length &gt; 1024 * 256) { // move to here } else { data = this.data.buffer; } </code></pre> <p>like so:</p> <pre><code>Chunk.prototype.readSlice = function(length) { if ((this.length() - this.internalPosition + 1) &gt;= length) { var data = null; if (this.data.buffer != null) { //Pure BSON if (this.data.buffer.length &gt; 1024 * 256) { data = this.data.buffer.slice(this.internalPosition, this.internalPosition + length); } else { data = this.data.buffer; } } else { //Native BSON data = new Buffer(length); length = this.data.readInto(data, this.internalPosition); } this.internalPosition = this.internalPosition + length; return data; } else { return null; } }; </code></pre> <p>The issue with windows files smaller than the chunk size is solved, but this isn't the most elegant solution. I'd like to propose this as the answer, but I realize using the default chunk size hard coded isn't the dynamic value which would make this less of a workaround ;-)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload