Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-60350

Can't use Buffer in mongodb 3.6 js script

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 3.6.3
    • None
    • None
    • ALL

    Description

      Hi,

      I write a js script for mongodb 3.6.3 (Ubuntu 18.04) where I want to use js / nodejs "Buffer", but script execution says:

       

      E QUERY [thread1] ReferenceError: Buffer is not defined 
      

      The minimal script where I can reproduce the issue is:

       

      let buff = new Buffer(10);
      buff[1] = 1;
      

      And the command line:

      mongo localhost:27017/dev minimal.js
      

      Can anybody help me, what did I wrong, or what am I miss?

      Thank you

      Attachments

        Activity

          People

            edwin.zhou@mongodb.com Edwin Zhou
            moravas8051@gmail.com norbert NNN
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: