skip to Main Content

How to make safety saving private keys to mongodb? JavaScript, node.js

using the web3.eth.account.create() method returns: { address: "0xb8CE9ab6943e0eCED004cDe8e3bBed6568B2Fa01", privateKey: "0x348ce564d427a3311b6536bbcff9390d69395b06ed6c486954e971d960fe8709", signTransaction: function(tx){...}, sign: function(data){...}, encrypt: function(password){...} } How to make safety saving private keys to mongodb? I was researching bcrypt, hashcode, but hascode is not safety and bcrypt encoding requires…

VIEW QUESTION

MongoDB 10m search documents

How can I optimize mongoDB search if I have 10+ million documents in one collection? If anything, please, don't advise me to switch to mysql. I need mongodb specifically For example one of the logs { "_id": { "$oid": "Some…

VIEW QUESTION

Using lookup with group in mongodb

I have a bunch of records in this format on mongodb [ {_id: 1, date:'2023-07-28',sales:1,ad_id:1,status: 'Active'}, {_id: 2 , date:'2023-07-29',sales:2,ad_id:1,status: 'Active'}, {_id: 3, date: '2023-07-30',sales: 4,ad_id:1,status: 'Paused'} ] Now if I want data from date 2023-07-28 to 2023-07-29 . I…

VIEW QUESTION

Constructing a MongoDB query to emulate JavaScript filtering logic (filter+every) using Mongoose for multiple search terms

Introduction I am building a search feature using mongodb with mongoose ODM. The codebase is already having an search feature using javascript. The code terms.every((term) => { const cleanedTerm = term.trim(); return ( usernameLower.includes(cleanedTerm) || nameLower.includes(cleanedTerm) || userTagsString.includes(cleanedTerm) || userLocationString.includes(cleanedTerm)…

VIEW QUESTION
Back To Top
Search