Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compound Index not being created #68

Closed
S4RD7R opened this issue Mar 2, 2017 · 3 comments
Closed

Compound Index not being created #68

S4RD7R opened this issue Mar 2, 2017 · 3 comments

Comments

@S4RD7R
Copy link

S4RD7R commented Mar 2, 2017

Case

BUG

Issue

I have a schema that defines a Compound Index.

The normal indexes are being created but the compound indexes are not created. I can't find any code that actually creates the compound indexes.

I assume there should be something in RxCollection in the prepare function where the normal indexes are created.

Info

  • Environment: Node.js, electron
  • Adapter: LevelDB

Code

Compound Index is being defined like this.

 {
  "$schema": "http://json-schema.org/draft-04/schema#",
  "version": 1,
  "disableKeyCompression": true,
  "type": "object",
  "properties": {
    "cacheKey": {
      "type": "string",
      "primary": true
    },
    "status": {
      "type": "number"  
    },
    "cloud": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "auth": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "path": {
          "type": "string",
        },
        "size": {
          "type": "integer"
        },
        "createdDate": {
          "type": "string",
          "format": "date-time"
        },
        "modifiedDate": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "auth",
        "name",
        "path",
        "size",
        "createdDate",
        "modifiedDate"
      ]
    },
    "cache": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "path": {
          "type": "string"
        },
        "addedDate": {
          "type": "string",
          "format": "date-time",
          "index": true
        },
        "lastModifiedDate": {
          "type": "string",
          "format": "date-time",
          "index": true
        },
        "size": {
          "type": "integer"
        }
      },
      "required": [
        "name",
        "path",
        "addedDate",
        "lastModifiedDate",
        "size"
      ]
    }
  },
  "required": [
    "status",
    "cloud",
    "cache"
  ],
  "compoundIndexes": [
    ["cache.name", "cache.path"]
  ]
}  

EDIT by pubkey: formated json

@pubkey pubkey closed this as completed in 7b0812e Mar 2, 2017
@pubkey pubkey reopened this Mar 2, 2017
@pubkey
Copy link
Owner

pubkey commented Mar 2, 2017

@MMJM I Published 3.0.2 which should fix this.
There were no tests for the creation of compound-indexes and so I overseen it when I refactored.

@S4RD7R
Copy link
Author

S4RD7R commented Mar 2, 2017

Wow thanks for your speedy fixes.

@S4RD7R
Copy link
Author

S4RD7R commented Mar 2, 2017

@pubkey Tested this and it works well.

@S4RD7R S4RD7R closed this as completed Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants