Sunspot solr query to fetch records with empty and non empty column data for all type - sunspot

We want to fetch records from sunspot solr with below conditions.
where column data blank.
where column data not blank.

Related

Is there any way to read and compare dates from nested JSON Array of Objects in PostgreSQL?

I have a column data in a Table. The data column has JSON stored. It has the following format I want to check if assignment_end_date in user_nodes_assignment is greater than or equal to some date return that record.
Previously I am able to achieve the equal condition using the following query
select id, data 
from "fq_DateUserPerformance" fdup2 
where fdup2.data #> '{"user_node_assignments": [{"assignment_start_date": "2022-03-18T17:09:55.176822+01:00"}]}'::jsonb
But I am not able to do the same for greater than or less than. Does anybody know how I can achieve this?
You're looking for a json path query:
select id, data
from "fq_DateUserPerformance" fdup2
where jsonb_path_match(fdup2.data, '$.user_node_assignments[*].assignment_start_date.datetime() >= "2022-03-18T17:09:55.176822+01:00".datetime()')

How to remove null matching document rows in case of populate in mongodb

Hello all I am new to mongodb and nodejs application .i want to join two documents and filter the same by query but it return null when no matching is found in second document i do not want null i want to remove that complete row

I want to get distinct and selected column names in mongodb

I want to get distinct of coulmn1 and the output should be selected column names(column1, column5) in mongodb

Using MongoDB to query selected field

I am trying to query out the data from my MongoDB database but there are some fields which I would like to omit as MongoDB will query the whole collections with id, n out.
I did this to limit the query but unfortunately only one field could be omitted but not the other which is the 'n' field. How can I omit two fields?
data = collection.find_one({"files_id": file_id},{"_id":0,"data":1})
And I also realized that my query for data has the field name (u'data') too, how can I query it so that it only returns the data? for this case it's a binary data
Example:
{u'data': Binary('\x00\x00\xed\x00\n\x00\x00\xd5\xa9\x00\x000\x00\x00\x00#\x00\x00\x0f\xff\xf0\x00\x0b\x80\x00\x00\x00
Kindly assist thanks!

Spring Data MongoDB return object converter

I have a large documents with 50 different fields in it. Only few fields are required when I save this document. When I fetch that document though Spring Data MongoDB is it possible to eliminate null value fields from the object?
During the save Spring Data MongoDB does the same thing and only save those values which are not null.
Our Query class has a fields() method which returns a Field object that allows defining which fields to be read from the document (Javadoc). Thus when executing the query object against a collection you get partial document back and thus a partially filled domain object.