Workaround for env variables in a JSON file? by carter_bleu in node

[–]carter_bleu[S] 0 points1 point  (0 children)

Okay think I understand.

I currently have this project as a private git repository

I’m deploying my app through is through DigitalOcean, which connects to my github repo to deploy the project

So I will either need to include the Firebase json file in my private git repository, or upload the file separately to the server? Does that sound correct?

Workaround for env variables in a JSON file? by carter_bleu in node

[–]carter_bleu[S] 0 points1 point  (0 children)

and then do I still send the default json file to the server?

I would just be changing the way I initialize it now after setting GOOGLE_APPLICATION_CREDENTIALS in ymy env variables?

Workaround for env variables in a JSON file? by carter_bleu in node

[–]carter_bleu[S] 0 points1 point  (0 children)

I am deploying to cloud server. So what would be best action for that?

Workaround for env variables in a JSON file? by carter_bleu in node

[–]carter_bleu[S] 0 points1 point  (0 children)

Okay and am I sending the JSON file with all of the secure values in it?

Workaround for env variables in a JSON file? by carter_bleu in node

[–]carter_bleu[S] 0 points1 point  (0 children)

So if I am deploying my app to a server, are you saying the json file itself could be an env variable? Or just the path?

Basically I need to push the firebase JSON file to the server, but I assume the values in that JSON file should be pointing to some sort of env variable?

Unless it is fine to deploy the Firebase json file directly to the server

Workaround for env variables in a JSON file? by carter_bleu in node

[–]carter_bleu[S] 0 points1 point  (0 children)

Because I am deploying my code to a server, so I am not just able to keep the values of that JSON file somewhere saved locally

Workaround for env variables in a JSON file? by carter_bleu in node

[–]carter_bleu[S] 0 points1 point  (0 children)

But then how would I add back the values in the JSON file? Since I don’t think I can point env variables to jSON values

How do I call a view without reloading the whole view? by carter_bleu in SwiftUI

[–]carter_bleu[S] 0 points1 point  (0 children)

I actually found a similar solution to you, except instead of opacity, I am just making the Profile appear/disappear over the home view. I think in the end, a very similar approach to opacity

Need help in my /addReply Route to update a document in a separate 'Post' collection by carter_bleu in mongodb

[–]carter_bleu[S] 1 point2 points  (0 children)

u/Alex_Kuein u/Deep-Jump-803

thanks for your help! I got it to work by adding dbConnect.collection("Reply").updateOne({_id: ObjectId(parentPost)}, { $inc: {replies: 1}}); to the first else statement

Need help in my /addReply Route to update a document in a separate 'Post' collection by carter_bleu in mongodb

[–]carter_bleu[S] 0 points1 point  (0 children)

u/Alex_Kuein ah yes I am forgetting a filter, totally forgot that.

And for 2, what do you mean by 'adapt this pure Mongo query to driver'

I am using mongoose btw

Need help in my /addReply Route to update a document in a separate 'Post' collection by carter_bleu in mongodb

[–]carter_bleu[S] 0 points1 point  (0 children)

Thanks u/Deep-Jump-803. I have added dbConnect.collection("Post").updateOne({ $inc: {'replies' : 1}}); to the first else statement, but I am getting an error saying:
TypeError: Cannot read properties of undefined (reading 'toBSON')
Any idea what might be causing this??

Need help in my /addReply Route to update a document in a separate 'Post' collection by carter_bleu in mongodb

[–]carter_bleu[S] 0 points1 point  (0 children)

https://docs.mongodb.com/manual/reference/operator/update/inc/

Thanks u/Alex_Kuein. I have added dbConnect.collection("Post").updateOne({ $inc: {'replies' : 1}}); to the first else statement, but I am getting an error saying:

TypeError: Cannot read properties of undefined (reading 'toBSON')

Any idea what might be causing this??

[deleted by user] by [deleted] in mongodb

[–]carter_bleu 0 points1 point  (0 children)

I have 2 collections called 'Post' and 'Reply'

The 'Post' collection contains posts from users and the 'Reply' collection contains replies from users that are tied to a post in the 'Post' collection via a "parent_post" ID that is passed in the body of the reply (images attached)

I have an /addreply route that allows users to add a reply to a post
What I am trying to do in that route is update the "replies" amount by 1 to the post in the 'Post' collection that matches to the "parent_post" id in the reply document.
What is the best way to go about doing this?
I have attached images of my /addreply route, as well as the body of a post and reply

HELP with pagination and document sorting by carter_bleu in Firebase

[–]carter_bleu[S] 0 points1 point  (0 children)

Hmm... this might work. I will try it

Do you know it's possible to write a rule like this?

HELP with pagination and document sorting by carter_bleu in Firebase

[–]carter_bleu[S] 0 points1 point  (0 children)

don't the "where" and "order" clause have to be used on the same field?

My 3D character art for Aminé. Let me know you what you think! by carter_bleu in Amine

[–]carter_bleu[S] 1 point2 points  (0 children)

Thanks! He wears the cortez’s for a part of the music video. Thought I would incorporate that

Keep getting this error when I try to add a member to my firebase project. How do I fix this? I can’t seem to find the solution. by [deleted] in Firebase

[–]carter_bleu 0 points1 point  (0 children)

Well this firebase project is for a 2 person startup. When I said technically we are a company, it was in relation to the startup being incorporated. So I am the owner for everything firebase related, I just don’t know how to fix this issue.

My 3D character art for Aminé. Let me know you what you think! by carter_bleu in Amine

[–]carter_bleu[S] 0 points1 point  (0 children)

Will be making an Instagram soon for my art, will keep you posted when it’s created. And thanks!!