rename the unique name at post request on firebase
See original GitHub issuesupport I am doing a post request on the firebase.
result = fb.post('/orders/', {'id': 2})
in result I always get the unique name generated at the time of post request. Like
{u'name': u'-KAdbw7DfCuuRhFWZH7j'}
But I need to give it name of my choice.
{u'name': 'aaa'}
Is there any means to do that.
Cause the item created needs to be access and updated using the put request so I need to pass this unique id to make a put request. If I would give the name of my choice I can use that name without passing an extra argument in my request json.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
Name generated when adding data in Firebase - Stack Overflow
Let's start by saving some user data to our Firebase database. We'll store each user by a unique username, and we'll also store...
Read more >Saving Data | Firebase Realtime Database - Google
Let's start by saving some user data to our Firebase database. We'll store each user by a unique username, and we'll also store...
Read more >Feat Request: Unique Value in Real Time Database
You can add a !data.exists() into the username index to prevent it from being overwritten by other users who might try to write...
Read more >CRUD in Firebase RealtimeDB with REST API - Retool
Try not to nest data. When you fetch data, all child nodes are returned with the one you fetched. · Flatten your data...
Read more >Rename your project - Firebase Help
Click next to the name for either Project name or Public-facing name. Enter a new name. Click Save.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@sanke93 @NYamaguchi415
I’m still able to do it:
What you should do is specify the name when you create the Firebase reference. And thereafter, you should post to that url.
For example, suppose
fb
is your firebase reference. You should create it as such:my_url = 'my_app.firebase.io/aaa'
fb = firebase.FirebaseApplication(my_url, None)
Now instead of posting, patch it…
result = fb.patch(my_url + '/orders', {'id': 2})
Your data should be in
'aaa'
as in…result = firebase.get(my_url + '/orders', 'id')
print result['id'] == 2
Let me know if that doesn’t work for you.