title: Convert byte array to Hex string using Mongoose Node JS
body: <p>I have a byte array field in mongodb. while reading i have to show the binary data as hex string. </p>
  
  <p>I am using express js, mongoose , node js to read data from mongodb. </p>
  
  <p>In java to convert hex string to byte array we have:</p>
  
  <p><strong>byte[] bytes = DatatypeConverter.parseHexBinary(s);</strong></p>
  
  <p>And byte array to hex string we have</p>
  
  <p><strong>DatatypeConverter.printHexBinary(bytes);</strong></p>
  
  <p>I want to similar function which does the same job in node js. </p>
  
  <p>also please guide me how to define schema to achieve in mongoose.</p>