Automate Document Checks - firebase

this is sort of a weird/complicated question but I thought id ask.
So during the sign up process for my app (I am using flutter and firebase for backend), people have to submit certain documents such as a resume and other official documents. My question was assuming the documents have a standard layout, is there any way to verify that it is the correct type of document automatically? So someone couldn't fake a document and sign up for the app.
I wanted to make it in a way so I wouldn't personally have to go through each document and make sure its the right one.
If anyone has any ideas please ping me and let me know.
Thanks!

Related

Pagination of data in Flutter with Firebase

I'm writing an app with a database of users. I want to show these to people on the app, and as such, in order to limit the download of data, I'm using the standard Firebase pagination concept:
.startAtDocument(lastDocumentSeen)
The problem is, I have no idea what actually happens when the 'read head' gets to the end of the database? Does Firebase/Flutter loop back and start to look at the top of the database again? If not, how does it signal to me that I've reached the end?
I've done quite extensive googling about this, and searched StackOverflow too, but can't seem to find any clear answers - does anyone know?
Assuming you have a query like this:
collectionRef.orderBy("something").startAfter(cursor).limit(10)
If there are not enough documents to return 10 results, Firestore will simply return however many documents are left. It does not perform any tricks beyond that.
You can use fetch_more package for pagination, it’s easy to use. You can see an example in the Example tab.
https://pub.dev/packages/fetch_more

How do I store related firebase data?

I'm making a firebase app where there's the concept of posts and authors.
I need to have a field called postedBy to give information about the post author. I'm currently confused on how to best implement this. Here's what I've thought about...
Store a postedBy field with the post author's ID as value. My issue with this is that I have to further send single requests for the user information, like name, profile picture etc.
I store a postedBy field with the exact clone of the author's data (name, profile URL, etc). My issue with this is what if the user changes their profile information? Do I have to loop through all the posts data to also ensure the changes?
What is the best way to solve an issue like this?
For your case, I would say that the best option would be probably to use only the ID as a value. This way, you can perform queries to return values using only the ID.
Using this approach should be the simplest and easiest way for you to create your application. Since the ID will be the point to connect your tables and to perform the queries, it should make your work easier.
In the below article, there is an example of a Blog application, that you can take a look and get some insights on how to configure your application as well - mainly about this part about author and post. :)
Learning Firebase: Creating a blog article object
Let me know if the information helped you!

Firebase Web - Getting UID's from other users

I'm trying to use the "orderByChild" functionality provided by Firebase, but I stumbled upon a roadblock. The structure of my database is very simple, it looks a bit like this:
Root
Users
${UID}
ID
Name
Birthday
...
Now, I'd like to search other user's names without knowing their UID.
Does anyone have an idea on how to solve this problem?
I could just download the users file completely but that does not seem like a good idea.
this about the question before posting it on stack overflow : you have to make a strategy to get this issue solved , I propose to you two possible solutions :
1)(very bad solution):
you parse the data from firebase and you put them in [<String , anyObject>] and you loop over this array in order to get the username that you want to get.
**
Ps: in term of performance and usability the worst thing that you
could do is to invoke the database to get unuseful data, so don't use
this solution in production.
**
2) you make a strategy for this:
look over what should be the relationship between a user and another and add new field for example friends and store on it the uids that you want to get.

Firebase Testing Data

We've been using Firebase for the past 7-8 months now.
It has been a really awesome tool, and thanks for the effort.
Here I have a question regarding whether there is a way to modify the data without actually writing to DB.
Cause most often when we debug something we always write to our live db, then we have to delete them manually. You can image how painful it is.
So is there like a test db where we can write stuff without worrying about modifying the db?
I can just export the whole db every time I want to write something, then import it back once I'm done. But it is a rather tedious procedure. And what if I am doing something to auth which there is no way to export users data at the moment.
The Firebase blog has a nice article about End-to-end Testing with firebase-server. This may be the solution for you.

Alfresco - How to get all checked out documents?

I'm trying to get a list of all checked out documents. Unfortunately, I'm new to Alfresco and can't quite figure out how to do this. I found this:
https://wiki.alfresco.com/wiki/CMIS_Web_Scripts_Reference#Get_Checked_Out_Documents_.28getCheckedOutDocs.29
Which is:
Gets the list of documents that are checked out that the user has access to.
But I don't want the checked out documents for just one user, I want the checked out documents of all users. Is there a way to get that?
Any help would be greatly appreciated, thanks!!
What you could do is create your own web script which you would execute with admin privileges (meaning, you'd act as an administrator, you'd see the whole repository, and you'd see all the documents in it).
Now, what you're missing is a way to find all the checked out documents. Well, when you check out a document, a working copy gets created (while the original remains locked). Working copy gets the "cm:workingCopy" aspect, while the original gets the "cm:checkedOut" aspect.
All your web script needs to do is to execute an aspect based query and find what you need. You can use Node Browser to test the query before writing any code.
ASPECT:"cm:checkedOut"

Resources