Skip to content

Parse creates incorrect index for pointer columns #4719

@ClaireNeveu

Description

@ClaireNeveu

Issue Description

Describe your issue in as much detail as possible.

Steps to reproduce

  1. Create a collection of the name Foo with a column testCol which is a Pointer to Foo (or any class)
  2. curl -X PUT http://localhost:7345/1/schemas/Foo -H 'content-type: application/json' -H "X-Parse-Application-Id: the_application_id" -H "X-Parse-Master-Key: the_master_key" -d '{"className":"Foo","indexes":{"testestest":{"testCol":1}}}'

Expected Results

Parse creates a mongo index on _p_testCol (the backing field of testCol).

Actual Outcome

Parse creates a mongo index on testCol (which doesn't exist in the mongo documents)

> db.getCollection('Foo').getIndexes()
[
	{
		"v" : 1,
		"key" : {
			"_id" : 1
		},
		"name" : "_id_",
		"ns" : "parse.Foo"
	},
	{
		"v" : 1,
		"key" : {
			"testCol" : 1
		},
		"name" : "testestest",
		"ns" : "parse.Foo"
	}
]

Environment Setup

  • Server

    • parse-server version: 2.7.4
    • Operating System: Arch Linux
    • Hardware: Thinkpad
    • Localhost or remote server? (AWS): localhost
  • Database

    • MongoDB version: 3.2
    • Storage engine:
rs0:PRIMARY> db.serverStatus().storageEngine
{
	"name" : "wiredTiger",
	"supportsCommittedReads" : true,
	"readOnly" : false,
	"persistent" : true
}
  • Hardware: Same as above
  • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): Same as above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions