In the new Firebase console I can't edit the name of nor clone nor move any node (change parent) of a realtime database
I have even tested setting Rules to Public.
Is this by design ? What then, is the use of this console ? ONLY to change child values ?
There is indeed no way to clone a node or rename a key in the Firebase Database console. Since the Firebase Database API doesn't have a clone/rename operation, we also don't have an equivalent in the UI.
Note that this operation also wasn't possible in the previous Firebase Dashboard, for the same reason. It has nothing to do with your security rules nor with the new release.
If you want to move a node to a new location, you'll have to emulate it:
Go to the Database tab in your Firebase Console
Navigate your JSON tree until you've selected the node that you want to move
Open the overflow menu (three vertical dots: ⋮) on the right and select Export JSON. Save the file to your local disk.
Delete the node from the JSON tree
Navigate your JSON tree to the location where you want to move the data
Open the overflow menu (three vertical dots: ⋮) on the right and select Import JSON. Select the file from your local disk.
Related
I am trying to figure out the best way to save an image (png) that is stored in my assets folder to my firebase database so I can retrieve that image/path for later use. Essentially this is what I want:
// savedPath was stored and then retrieved from database
let savedPath = '../assets/images/example.png'
return (<Image source={require(savedPath)} />)
However, if I just save the path as a string, I can not insert it into the image source like this and it throws an error. I am wondering what my alternative option is to achieve that same thing as the example above?
You can use firebase storage bucket https://firebase.google.com/docs/storage/ to store all your assets
Then you can store the file name/path in your database and access it from there.
Read-only & non-realtime mode activated to improve browser performance
Message pops up in my project and I'm unable to delete the nodes as well
Also I read this https://groups.google.com/forum/#!topic/firebase-talk/qLxZCI8i47s
Which states :
If you have a lot of nodes in your Firebase (say thousands), we need to create a new element for each node and modern browsers simply have limitations of how many DOM elements you can add to a page
It says:
To resolve this problem, don't load your Firebase Dashboard at the root of your Firebase, but instead load it lower down in the hierarchy
I do not get what it means
How do I get back to my Realtime Dashboard?
If you want to delete a high level node when this is activated, I recommend doing this.
Open up a text editor and type in { }. Save this file as "blankJSON.json".
Go to high level node you want deleted and select it, once it opens up and shows you all the nodes that need to be removed, select the three bars at the top right and select "Import JSON", (It would be safe to first "Export JSON" If you don't have backups, in case you make a mistake here). Import the JSON file we created earlier titled "blankJSON".
This will delete all of the data inside.
Once again, I highly suggest you make a backup before doing this, It's extremely easy to make a backup and also it is much easier than you would think to upload this blankJSON to the wrong node and then erasing a bunch of important data.
When it detects that it's downloading too many nodes from your database, the Firebase Console stops using real-time mode and switches to read-only mode. In this mode it requires less work from the browser, so it is more likely that the browser will stay performant.
To get back to realtime mode, you have to go to a location that has fewer nodes. So say that you start loading the database at the root, that means that "pseudo address bar" at the top of the data tree will say:
https://<your-project>.firebaseio.com/
And then will show the list of items. Now click on the URL in that pseudo address bar and change it to:
https://<your-project>.firebaseio.com/<one-of-your-keys>
And hit enter. The data tree will reload with just the node from one-of-your-keys and down and will likely switch to realtime mode again.
Every node key in firebase is a link, you can open a sub-node in a new tab and then edit that sub-node and its children.
Right click on a sub-node you want to edit or delete
Select open link in a new tab
Edit the sub-node in the new tab
1) Click on the Node you want to mass delete
2) Import an empty .json file (just containing curly braces, {} )
3) The node value will be set to null, in other words it is deleted or rather overridden with an empty node!
What you can do is to have an OnClickListener and call the remove value method to your DatabaseReference, like this:
mCart.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
mDatabaseReference.removeValue();
}
});
I have the same problem... I'm a bit surprised because I though Firebase could easily scale to support huge amount of data (example million users, etc.).
I have a node with 80000 sub-nodes (each object has his own push-id) and I cannot delete or perform any action on it because the real-time doesn't work in Firebase console.
I think the only way to udate or delete the data it's to do it via JAVA code :(
Multiple times trying to load the specific keys can be tiresome. There is a python library that could do this for you easily.
http://ozgur.github.io/python-firebase/
I needed to delete a lot of keys and this helped me do that in one go.
What I do is export the entire tree, edit/add the node I want using an editor, then import the JSON and overwrite the previous node/tree. Problem solved! Risky though 😁
In the new Firebase console I can't edit the name of nor clone nor move any node (change parent) of a realtime database
I have even tested setting Rules to Public.
Is this by design ? What then, is the use of this console ? ONLY to change child values ?
There is indeed no way to clone a node or rename a key in the Firebase Database console. Since the Firebase Database API doesn't have a clone/rename operation, we also don't have an equivalent in the UI.
Note that this operation also wasn't possible in the previous Firebase Dashboard, for the same reason. It has nothing to do with your security rules nor with the new release.
If you want to move a node to a new location, you'll have to emulate it:
Go to the Database tab in your Firebase Console
Navigate your JSON tree until you've selected the node that you want to move
Open the overflow menu (three vertical dots: ⋮) on the right and select Export JSON. Save the file to your local disk.
Delete the node from the JSON tree
Navigate your JSON tree to the location where you want to move the data
Open the overflow menu (three vertical dots: ⋮) on the right and select Import JSON. Select the file from your local disk.
Earlier when using Firebase, there was an option to use our own url like myapp.firebaseapp.com (including firebaseapp.com part). But from May 2016, when I create a project, it gets an auto-generated URL like my-app-1c75b.firebaseio.com, and I cannot find place to edit that (because 1c75b part in URL is not nice). I want to know is there any way to edit that like before?
Note - I don't want to use a paid domain like www.example.com. I just want to customize my Firebase URL as myapp.firebaseapp.com
When you create a project in the new Firebase console, it will indeed add a "random" code to the project name. There is currently no way to prevent this code in the new console.
When you upgrade an existing project from firebase.com into the new console, the app name will remain unchanged. So if you already have myapp.firebaseapp.com on a firebase.com project, you will keep that URL after importing/upgrading.
When creating a new project, you get an screen where you can enter the name.
In the textfield for project-id ou can enter a project-id.
your project-id needs to include a dash
when it doesn't, it will say something like, it is already used or it places the dash itself, with some custom characters.
The project-id itself is fixed, so you should create a new project and copy everything.
When you create your project the url is based on the project name you give. If your project name is "Foo Bar", your url will be https://foo-bar.firebaseapp.com (assuming it isn't already taken).
Last week Create Project window was showing possible firebase.com subdomain that will be assigned while you were typing project name. It's first come - first served basis so if you type a name already taken it automatically adds some character-number combination at the end.
Today same window doesn't show that while typing, you can only see it after you create your project and go to settings dashboard, there is no way to change given subdomain on the same dashboard.
Update 10.07.2017
I'm getting random hex number added from time to time, I can't always get plain name even if name is supposedly original one.
If you choose a name unique enough within Firebase, they will give you a domain for your app as in https://myapp.firebaseio.com.
I tried several times, sometimes it gives something like https://project-(long-random-number-sequence).firebaseio.com and other times something like what you've encountered. My personal experience shows if you give your app a name suffixed with "app" then you have a higher chance of being unique and getting the "nice" URL.
Scroll down in 'Manage Site' and create a new site, then deploy there.
You can't change your domain, but you can change the host! You can make as many sites as you want.
What would cause multiple documents on my catalog to have the same "unique id"? Effectively an error like this:
ERROR Products.ZCatalog A different document with value
'xxxx341a9f967070ff2b57922xxxx' already exists in the index.'
And how do I go about fixing it?
I had the same error today.
In short: the UID index in portal_catalog (ZCatalog UUIDIndex) complains that you are trying to index multiple objects with the same UID
In my case it was caused by a zexp import of a folder that contained images that where already available in another folder.
To reproduce:
copy production buildout, database and blobstorage to staging server
do some changes to staging.com/folder1
move staging.com/galleries/gallery1 to staging.com/folder1
export staging.com/folder1 to folder1.zexp
remove production.com/folder1
use ZMI import/export on production.com/manage to import folder1.zexp
you'll get these errors for the gallery1 folder and all of its content items:
2015-06-15T17:58:22 ERROR Products.ZCatalog A different document with value '618a9ee3544a4418a1176ac0434cc63b' already exists in the index.'
diagnosis
production.com/resolveuid/618a9ee3544a4418a1176ac0434cc63b
will take you to production.com/galleries/gallery1/image1
whereas staging/resolveuid/618a9ee3544a4418a1176ac0434cc63b
will take you to staging.com/folder1/gallery1/image1
production.com/folder1/gallery1/image1 did get cataloged too, but because it has the same uid as production.com/galleries/gallery/image1 results of resolveuid, catalog queries, internal links and such stuff might be random
how to repair
In my case I think it's probably the best to either
delete production.com/galleries/gallery1 and run a clear and rebuild on the portal catalog.
or replace production.com/folder1/gallery by production.com/galleries/gallery1 (delete, cut, paste)
If the objects with the same UID are not actually the same (as in my case) you might be able to give them new and uniques UIDS using object._setUID('new-uid') and rebuild the catalog afterwards.