top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Encrypting only the value in key-value pair in mongodb

0 votes
32 views

I want to implement the encryption and that to only to value in key-value pair in mongodb .Can anyone please provide a workable solution?

posted Oct 7, 2016 by anonymous

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

Hi try this solution on mongo console alternative way to do the same is that you can use md5 or sha-1 at front end/back end depending on your requirement.

db.collection.find().forEach( function(info){
  info.hashValue = hex_md5(info.value);
  db.collection.save(info);
}); 
answer Oct 8, 2016 by Shivam Kumar Pandey
Similar Questions
+1 vote

Query description: I have a collection name student_db and added a document in a collection with entries (name: "alok, age : 31 and profession: "xyz"). After inserting the document into student_db database, I want to add another (key:value ) pair i.e. salary: 50000.

Can someone help me out to resolve this problem ?

+1 vote

I only want to enable client authentication when deploy a mongodb replica set, as dont want to use the --keyfile option. Cant find useful information relate to this scenario by google...

If yes, could you share some guide link if have?

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...