parse-community / parse-community/parse-server

Query on a subfield date on an array with js native date object does not work

Open
#8,001 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

New Issue Checklist
Issue Description

PArse.Query on a subfield date on an array with js native date object does not work

Steps to reproduce

quick example:

const obj = new Parse.Object('Example')
obj.set('anArrayField', [{ date: new Date(0) }])
await obj.save()

// Elsewhere later
const query = new Parse.Query('Example')
query.lessThan('anArrayField.date', new Date())

const result = query.find()
// Result is empty but it should contain obj 
Actual Outcome

Empty result, maybe related to incorrect handling of native JS date

Expected Outcome

Query a subfield date on an array with js native date object should work

Environment

Version 5.2.1

Server

  • Parse Server version: 5.2.1
  • Operating system: OsX
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 4.4.2
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): local

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): JavaScript
  • SDK version: 3.4.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided JavaScript reproduction against Parse Server with MongoDB, then trace query.find() handling for nested array date comparisons. The payload names no source file or regression test; done means the query returns the saved object and a regression test demonstrates the expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.