How to use both where and orderBy filters in firestore [duplicate]Firestore whereEqualTo, orderBy and limit(1) not workingWhy does this firestore query require an index?What is the best way to filter a Java Collection?Filtering for empty or NULL names in a querysetlist comprehension vs. lambda + filterHow to design RESTful search/filtering?Firebase WEB - Email Verification not being sent. What's wrong with the codeWhat's the difference between Cloud Firestore and the Firebase Realtime Database?What is firestore Reference data type good for?Firestore query subcollectionsWhy Does My Firebase HTTPS Function Go Silent When I Try to Save to Firestore?Firebase Firestore - Query for posts in a big collection where groupId should match a value in an array

When calculating averages, why can we treat exploding die as if they're independent?

Was Robin Hood's point of view ethically sound?

How should we understand "unobscured by flying friends" in this context?

Distinguishing between octahedral and tetrahedral holes

Can you pop microwave popcorn on a stove?

If every star in the universe except the Sun were destroyed, would we die?

How should Thaumaturgy's "three times as loud as normal" be interpreted?

Features seen on the Space Shuttle's solid booster; what does "LOADED" mean exactly?

Strategies for dealing with chess burnout?

Lost & Found Mobile Telepone

More than three domains hosted on the same IP address

Why is it that I have to play this note on the piano as A sharp?

How is lower/no gravity simulated on a planet with gravity, without leaving the surface?

Problem with listing a directory to grep

Does the word voltage exist in academic engineering?

How to set any file manager in Linux to show the duration like the Length feature in Windows Explorer?

Supervisor wants me to support a diploma-thesis software tool after I graduated

Is future tense in English really a myth?

Yet another calculator problem

Is every sentence we write or utter either true or false?

Methods and Feasibility of Antimatter Mining?

How to find a reviewer/editor for my paper?

What can we do about our 9-month-old putting fingers down his throat?

Electric shock from pedals and guitar. Jacks too long?



How to use both where and orderBy filters in firestore [duplicate]


Firestore whereEqualTo, orderBy and limit(1) not workingWhy does this firestore query require an index?What is the best way to filter a Java Collection?Filtering for empty or NULL names in a querysetlist comprehension vs. lambda + filterHow to design RESTful search/filtering?Firebase WEB - Email Verification not being sent. What's wrong with the codeWhat's the difference between Cloud Firestore and the Firebase Realtime Database?What is firestore Reference data type good for?Firestore query subcollectionsWhy Does My Firebase HTTPS Function Go Silent When I Try to Save to Firestore?Firebase Firestore - Query for posts in a big collection where groupId should match a value in an array






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0
















This question already has an answer here:



  • Why does this firestore query require an index?

    2 answers



  • Firestore whereEqualTo, orderBy and limit(1) not working

    1 answer



Its working fine
firebase.firestore().collection('Location').orderBy("syncedAt", "desc").get()



its also working fine
firebase.firestore().collection('Location').where('email', '==', email).get()



but using both orderBy and where not working



getUserPastInformation = async (email) => 
this.Location = firebase.firestore().collection('Location').orderBy("syncedAt", "desc").where('email', '==', email)
await this.Location.limit(10).get().then(res =>
let locationHistory = []
this.setState( lastData: res._docs[res._docs.length - 1]._data.syncedAt )
res.docs.forEach(element =>
locationHistory.push(element.data())

);
const data = locationHistory.sort((a, b) => Moment(b.syncedAt).unix() - Moment(a.syncedAt).unix());
if (res.docs.length > 0)
this.setState(
locationHistory: data,
loader: false
)

).catch(err =>
console.log('err----->>>', err)
);










share|improve this question














marked as duplicate by Alex Mamo firebase
Users with the  firebase badge can single-handedly close firebase questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 28 at 10:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • Would you mind swapping it around where and order by and let me know what happens? If not then you might have to retrieve the collection and then apply the next function on your previous result

    – Mohamed Omar
    Mar 28 at 7:41


















0
















This question already has an answer here:



  • Why does this firestore query require an index?

    2 answers



  • Firestore whereEqualTo, orderBy and limit(1) not working

    1 answer



Its working fine
firebase.firestore().collection('Location').orderBy("syncedAt", "desc").get()



its also working fine
firebase.firestore().collection('Location').where('email', '==', email).get()



but using both orderBy and where not working



getUserPastInformation = async (email) => 
this.Location = firebase.firestore().collection('Location').orderBy("syncedAt", "desc").where('email', '==', email)
await this.Location.limit(10).get().then(res =>
let locationHistory = []
this.setState( lastData: res._docs[res._docs.length - 1]._data.syncedAt )
res.docs.forEach(element =>
locationHistory.push(element.data())

);
const data = locationHistory.sort((a, b) => Moment(b.syncedAt).unix() - Moment(a.syncedAt).unix());
if (res.docs.length > 0)
this.setState(
locationHistory: data,
loader: false
)

).catch(err =>
console.log('err----->>>', err)
);










share|improve this question














marked as duplicate by Alex Mamo firebase
Users with the  firebase badge can single-handedly close firebase questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 28 at 10:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • Would you mind swapping it around where and order by and let me know what happens? If not then you might have to retrieve the collection and then apply the next function on your previous result

    – Mohamed Omar
    Mar 28 at 7:41














0












0








0









This question already has an answer here:



  • Why does this firestore query require an index?

    2 answers



  • Firestore whereEqualTo, orderBy and limit(1) not working

    1 answer



Its working fine
firebase.firestore().collection('Location').orderBy("syncedAt", "desc").get()



its also working fine
firebase.firestore().collection('Location').where('email', '==', email).get()



but using both orderBy and where not working



getUserPastInformation = async (email) => 
this.Location = firebase.firestore().collection('Location').orderBy("syncedAt", "desc").where('email', '==', email)
await this.Location.limit(10).get().then(res =>
let locationHistory = []
this.setState( lastData: res._docs[res._docs.length - 1]._data.syncedAt )
res.docs.forEach(element =>
locationHistory.push(element.data())

);
const data = locationHistory.sort((a, b) => Moment(b.syncedAt).unix() - Moment(a.syncedAt).unix());
if (res.docs.length > 0)
this.setState(
locationHistory: data,
loader: false
)

).catch(err =>
console.log('err----->>>', err)
);










share|improve this question















This question already has an answer here:



  • Why does this firestore query require an index?

    2 answers



  • Firestore whereEqualTo, orderBy and limit(1) not working

    1 answer



Its working fine
firebase.firestore().collection('Location').orderBy("syncedAt", "desc").get()



its also working fine
firebase.firestore().collection('Location').where('email', '==', email).get()



but using both orderBy and where not working



getUserPastInformation = async (email) => 
this.Location = firebase.firestore().collection('Location').orderBy("syncedAt", "desc").where('email', '==', email)
await this.Location.limit(10).get().then(res =>
let locationHistory = []
this.setState( lastData: res._docs[res._docs.length - 1]._data.syncedAt )
res.docs.forEach(element =>
locationHistory.push(element.data())

);
const data = locationHistory.sort((a, b) => Moment(b.syncedAt).unix() - Moment(a.syncedAt).unix());
if (res.docs.length > 0)
this.setState(
locationHistory: data,
loader: false
)

).catch(err =>
console.log('err----->>>', err)
);





This question already has an answer here:



  • Why does this firestore query require an index?

    2 answers



  • Firestore whereEqualTo, orderBy and limit(1) not working

    1 answer







firebase filter google-cloud-firestore






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 28 at 7:37









Jomi MosesJomi Moses

33 bronze badges




33 bronze badges





marked as duplicate by Alex Mamo firebase
Users with the  firebase badge can single-handedly close firebase questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 28 at 10:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.











marked as duplicate by Alex Mamo firebase
Users with the  firebase badge can single-handedly close firebase questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 28 at 10:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Alex Mamo firebase
Users with the  firebase badge can single-handedly close firebase questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 28 at 10:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Would you mind swapping it around where and order by and let me know what happens? If not then you might have to retrieve the collection and then apply the next function on your previous result

    – Mohamed Omar
    Mar 28 at 7:41


















  • Would you mind swapping it around where and order by and let me know what happens? If not then you might have to retrieve the collection and then apply the next function on your previous result

    – Mohamed Omar
    Mar 28 at 7:41

















Would you mind swapping it around where and order by and let me know what happens? If not then you might have to retrieve the collection and then apply the next function on your previous result

– Mohamed Omar
Mar 28 at 7:41






Would you mind swapping it around where and order by and let me know what happens? If not then you might have to retrieve the collection and then apply the next function on your previous result

– Mohamed Omar
Mar 28 at 7:41













0






active

oldest

votes














0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.





Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현