Having Trouble Querying Using Datetime #591
Replies: 1 comment
-
This should be a duplicate of #474. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In Firebase, we have values in the format shown in the image below:
![image](https://private-user-images.githubusercontent.com/155732803/314980373-b7da5b71-623b-4db9-8453-4a815966f171.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg1Mzk0MzQsIm5iZiI6MTcxODUzOTEzNCwicGF0aCI6Ii8xNTU3MzI4MDMvMzE0OTgwMzczLWI3ZGE1YjcxLTYyM2ItNGRiOS04NDUzLTRhODE1OTY2ZjE3MS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYxNlQxMTU4NTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iN2NmMjg4ZWZkY2ZkYmRjMDk5M2M5ODk4YjE4MGY4MzdkNTk1MDcwMGQ5NmEwYmQ3NjBiMzYxYmVhYjY2MmI4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.fzQA0RXlGZli-73uMUgt4jglbkIKvAEk9MgQ4ha6AFk)
I am using the following function to retrieve dates:
public GetAllCheckInUser(filterData): any {
var date = moment(new Date()).subtract(1, 'h').toDate();
console.log('date',date);
return from(FirebaseFirestore.getCollection({
reference: 'LoggedinUser',
compositeFilter: {
type: 'and',
queryConstraints: [
{
type: 'where',
fieldPath: 'LoggedinAt',
opStr: '>',
value: date,
},
],
},
}))
.pipe(
map((actions) => actions.snapshots.map(a => {
const data = a.data as any;
const id = a.id;
return { id, ...data };
})),
map((data: any) => {
return _.filter(data, (item) => item.AccountNumber !== null);
})
);
}
However, it's not working correctly. We used Firebase Firestore collection query referred from
https://github.com/capawesome-team/capacitor-firebase/tree/main/packages/firestore
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions