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;
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)
);
firebase filter google-cloud-firestore
marked as duplicate by Alex Mamo
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.
add a comment |
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)
);
firebase filter google-cloud-firestore
marked as duplicate by Alex Mamo
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
add a comment |
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)
);
firebase filter google-cloud-firestore
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
firebase filter google-cloud-firestore
asked Mar 28 at 7:37
Jomi MosesJomi Moses
33 bronze badges
33 bronze badges
marked as duplicate by Alex Mamo
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
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
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
add a comment |
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
add a comment |
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.
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