title: server side Mongodb GridFS file copying
body: <p>Per business requirements I need provide possibility to copy content of some file on GridFS. Of course it can be done over domain-specific layer. But in this case I can see some overhead: </p>
  
  <ul>
  <li>take stream from mongo-server</li>
  <li>allocate memory on business-layer</li>
  <li>read</li>
  <li>place back to mongo-server</li>
  </ul>
  
  <p>Obvious solution is write mongo-side JavaScript that will perform copying in bound of single server.
  So my questions:</p>
  
  <ul>
  <li>Where is the description of API to manage GridFS on JavaScript?</li>
  <li>Is there any issues if my GridFS is sharded?</li>
  <li>Is there any issues if my GridFS is replicated?</li>
  </ul>
  
  <p>Thank you in advance</p>