How to Query Realm DB Browser? - realm

I need to filter the DB on the basis of Id. On top there is search bar stating "Enter the query to filter the list". How to query to get some specific id filtered in RealmDB browser.
My DB URL: https://i.stack.imgur.com/G1iXY.png

That field is used to enter queries aka Filter. Suppose you have a Dog Class with a dog_name property. To search for a Dog with the name Fido, you would enter this into the field
dog_name == "Fido"
The field is evaluated live so as soon as a valid query is entered, the results are updated.
If you look at the docs (this is Swift) you will see an example like this
// Query using a predicate string
var tanDogs = realm.objects(Dog.self).filter("color = 'tan' AND name BEGINSWITH 'B'")
To apply the same filter, just use the part within the quotes in Realm Studio
color = 'tan' AND name BEGINSWITH 'B'

Related

Cosmos DB simple ID field for end user

Is it possible to include a user friendly ID field into cosmos db documents? This doesn't need to override the default id field that generates when adding a document but can be a custom one that is simple for an end user to know and search for.
Example document, the ref field is what I want to generate as a simple human readable identifier.
{
"id": "57275754475457-5445444-44420478",
"ref": "45H7GI",
"userId": "48412",
"whenCreated": "D2021-11-09T21:56:31.630",
"tenantId": "5566HH"
}
I'm looking at building a ticketing system and would like a simple ID field for a user to be sent and who can reference when updating/ searching for.
Any help with this would be appreciated.
For your own purposes, you can choose to either use id (which is guaranteed to be unique within a partition) or your own property (such as ref as you defined in your example). For any property other than id, you'd need to add a unique-key constraint when creating the container (and at that point, ref would be unique within any partition, just like id).
Really your choice whether you store your custom id's in id or ref. Just know that, if you ever want to do a direct-read (instead of a query), you can only do a direct-read against an id, not against any other property.

How to filter out matching usernames form firestore database in flutter social media application

So I am creating a Social media appliation with the help of flutter. And in search user page I had created a page where user can search their friends with their Profile names. And in this I used:-
Future allUsersProfile = FirebaseFirestore.instance.collection("users").where("profileName", isGreaterThanOrEqualTo: str).get();
By this I get all the matching profile names.
But when I enter their last name their is no result.
Also I want to convert profile names to lower case and then match.
Also I want that if the search name is in between the saved profile name(for example :- I want to search "arsh" form "Harsh", I can't find the result.
) then also it should give this particular result,
So I want idea that how big social media companies search users.
Can anyone can help me.
Thanks in advance
Assuming you are storing profileName in the same field(including first and last names). i.e, in your Firebase user document, profileName combines both first and last names. You need to do the following:
1- In your Firebase users collection, store a new field for every document called something like 'searchName'.
2- When you store your user info, use this code to to convert profileName into searchName:
String profileName = 'Huthaifa Muayyad`;
String searchName = profileName.toLowerCase().replaceAll(' ', '');
//The .toLowerCase method converts it all to lower case
//The replaceAll, removes the whitespaces.
//Notice the difference between (' ', '').
//This will result in Huthaifa Muayyad => huthaifamuayyad
3- Save both fields in firebase along with all the other info when you create the user.
4- Assuming that str is the input you are getting from the search field, modify your Firebase query to look like this:
Future allUsersProfile = FirebaseFirestore.instance.collection("users").where("searchName", isGreaterThanOrEqualTo: str.toLowerCase().replaceAll(' ', '')).get();
This should solve your problem.

Can i search all push ids from the database without having to do it on the app side

I have a question about searching the database. Right now the database looks like this. first child = "hello" then second child is a pushid. and every push id has a few ids i want to look up. Can I somehow search through all push ids and return only the ones with the correct id or do i have to get all push ids and manually go through them on the app side?
FirebaseDatabase.instance.reference().child("hello").child(***this is the push id***).child("id to look up");
To recap: can I search all push ids on the database side and return only the children with the last id somehow?
If this doesn't make sense please tell me to clarify something.
To get only the child node under a list, you can do:
var ref = FirebaseDatabase.instance.reference().child("hello");
var query = ref.orderByKey().limitToLast(1);
And then you use that query to read the values, or bind to a widget.
To get nodes where a specific child property matches a specific value, you'd use this query:
var query = ref.orderByChild("id").equalTo("abc");

Application Insights - How to search by some properties in custom dimension

I am using mobile application i.e Appcenter for recording customevents AzureLogportal.
I am trying to fetch the records by using custom query.
Inside customDimensions Object of array i.e Properties i stored.
Properties = {"1":"Studentname","101":"id","John":"Title"}
I am trying to fetch all the records for title : John in the properties.
Query i tried is :
customEvents
|where customDimensions.Properties.TopicTitle == "John"
But it dont give any result.Please help.
if Properties within customDimensions is a property bag, then the bottom note in this document should have the answer
https://learn.microsoft.com/en-us/azure/kusto/query/parsejsonfunction
Notes
It is somewhat common to have a JSON string describing a property bag in which one of the "slots" is another JSON string. For example:
let d='{"a":123, "b":"{\\"c\\":456}"}';
print d
In such cases, it is not only necessary to invoke parse_json twice, but also to make sure that in the second call, tostring will be used. Otherwise, the second call to parse_json will simply pass-on the input to the output as-is, because its declared type is dynamic:
let d='{"a":123, "b":"{\\"c\\":456}"}';
print d_b_c=parse_json(tostring(parse_json(d).b)).c

how to write where condition in fql facebook using asp.net?

I need to execute a fql using facebook dll in asp.net.
The fql is ="select name, profile_url from user where name = 'suresh'". When I execute this i could not get the response . I am getting only empty string.
string response = fbService.fql.query("select name, profile_url from user where name = 'suresh'");
but if i search by id i can get response..
so, how to search by name in that..
thanks
r.eswaran.
The name field contains the full name. It can't be a just a partial value. Are you sure that the full value isn't something like 'Suresh Lastname' ?
I recommend you use the Facebook API Test Console to test out the queries. It can be found at:
http://developers.facebook.com/tools.php
Select "fql.query" as the method. It will come up with a field where you can enter your FQL queries to test.

Resources