storing a byte[] array in MongoDB
-
I store a secret as byte[] in MongoDB, and went to decrypt and it failed. so In my .Net class I used byte[]. "Secret" : { "$binary" : "o2lBkODfRqw=", "$type" : "00" }, What would be the correct way? string? to Base64 and back on a side note, I used Bson Date format to store a date, but in TypeScript can't pull the time offset from it. Should I just dump the Bson decorator and just use Date? Or just test and see if it works.
If it ain't broke don't fix it Discover my world at jkirkerx.com
-
I store a secret as byte[] in MongoDB, and went to decrypt and it failed. so In my .Net class I used byte[]. "Secret" : { "$binary" : "o2lBkODfRqw=", "$type" : "00" }, What would be the correct way? string? to Base64 and back on a side note, I used Bson Date format to store a date, but in TypeScript can't pull the time offset from it. Should I just dump the Bson decorator and just use Date? Or just test and see if it works.
If it ain't broke don't fix it Discover my world at jkirkerx.com
My Bad, I can store a byte[] in MongoDB. I had changed the secret by mistake on login.
If it ain't broke don't fix it Discover my world at jkirkerx.com
-
My Bad, I can store a byte[] in MongoDB. I had changed the secret by mistake on login.
If it ain't broke don't fix it Discover my world at jkirkerx.com
Glad you got it sorted. How's Mongo been treating you?
"Never attribute to malice that which can be explained by stupidity." - Hanlon's Razor
-
Glad you got it sorted. How's Mongo been treating you?
"Never attribute to malice that which can be explained by stupidity." - Hanlon's Razor
So far so good. I really like it. Finally got use to the ObjectId and my models are matching up in .Net Core and Angular. The Net Core Mongo drivers are pretty cool, but a whole different beast. MongoDB is fine for my portfolio website and a good learning experience. Got praise last night at the Agile meetup for taking the time to learn it. So it be a valuable tool or experience. I’m in Vegas for the weekend, won $50 so far.
If it ain't broke don't fix it Discover my world at jkirkerx.com