A newer version of this documentation is available.
View Latest (v2.0)

Gluesync SQL to NoSQL

Customizing document IDs

By default Gluesync stores documents on a target datastore with an ID that looks like this: TABLENAME::1 where TABLENAME is your source entity name, :: is the default separator and 1 is one of your PKs or defined key value. Of course, multiple keys are supported and will be added one after the other separated by the default separator value.

Customizing the default behavior

You can customize the default behaviour by specifying in your source config file this mapping:

{
  ...

  "entitiesKeyMapping": {
    "MYENTITY": {
      "separator": "_",
      "fields": ["ORDERS_ID"],
      "prefix": ""
    },
    "CUSTOMERS": {
      "separator": ":",
      "fields": ["ID"],
      "prefix": "ID"
    },
    "ADDRESSES": {
      "separator": "-",
      "fields": ["AD_ID"],
      "prefix": "ADR_ID"
    },
    ...
  },
...
}
  • entity name: the name of the source entity, as per our example here MYENTITY or ADDRESSES;

    • separator (can be left empty as ""): defaults to ::. Is the string used as a separator between entity name and each of your keys;

    • fields (array): is the list of each one of your keys. You should use the real column name, aliases are not supported;

    • prefix (can be left empty as ""): defaults to entity name. Is the prefix used when composing the object key, for example: ADR_ID-1 where ADR_ID is the prefix, - is the value separator and 1 is the value of AD_ID key/column.