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

Unable to save array entry for list<text> column #84

Open
tejashande opened this issue Oct 13, 2019 · 12 comments
Open

Unable to save array entry for list<text> column #84

tejashande opened this issue Oct 13, 2019 · 12 comments
Assignees
Labels

Comments

@tejashande
Copy link

tejashande commented Oct 13, 2019

I am using Cassandra datasource in loopback 3, and trying to store values in list datatype column of a table(keyspace) of Cassandra datasource. But while creating an entry from loopback explorer, we are getting TypeError: Not a valid list value, expected Array obtained '["Morning","Afternoon","Evening"]'

Here is my loopback model:

{
  "name": "Time",
  "base": "PersistedModel",
  "idInjection": true,
  "options": {
    "validateUpsert": true
  },
  "properties": {
    "options": {
      "type": "array",
      "format": "list"
    }
  },
  "validations": [],
  "acls": [],
  "methods": {}
}

Tried debugging loopback-cassandra-datasource and saw options converted to string in params.

Data passed from loopback explorer:

{
  "options": ["Morning","Afternoon","Evening"]
}

Data logged from beforeRemote hook of the model:

{ options:
   [ 'Morning',
     'Afternoon',
     'Evening' ]
}

package.json

"dependencies": {
  "loopback": "3.26.0",
  "loopback-boot": "2.28.0",
  "loopback-component-explorer": "6.4.0"
  "loopback-connector-cassandra": "1.7.1"
}

The typeof options is object. I was debugging loopback cassandra connector and found typeof options as string in encoder.js of cassandra-driver node module. We have migrated from MongoDB to Cassandra and didn't face any issues for MongoDB driver. To what type or which format do I need to set for options property? Please let me know if any additional information required. Thank you in advance.

@dhmlau
Copy link
Member

dhmlau commented Oct 22, 2019

@raymondfeng, since you're familiar with the cassandra connector, could you please help on this? Thanks!

@stale
Copy link

stale bot commented Dec 21, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 21, 2019
@stale
Copy link

stale bot commented Jan 4, 2020

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Jan 4, 2020
@rodosj89
Copy link

hi, i have the same problem described. Was any solution found? Cheers

@dhmlau dhmlau reopened this Mar 31, 2020
@stale stale bot removed the stale label Mar 31, 2020
@dhmlau
Copy link
Member

dhmlau commented Mar 31, 2020

Reopening the issue.

@shenghu, do you think you can help on this? Thanks!

@stale
Copy link

stale bot commented May 30, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 30, 2020
@stale stale bot removed the stale label Jun 9, 2020
@himanshurobo
Copy link

I am facing the same issue. Is there any update on this?

@stale
Copy link

stale bot commented Aug 8, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 8, 2020
@stale
Copy link

stale bot commented Aug 22, 2020

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Aug 22, 2020
@watduh
Copy link

watduh commented Sep 17, 2021

The issue is not closed few folk as myself have the issue

@achrinza achrinza reopened this Sep 18, 2021
@stale stale bot removed the stale label Sep 18, 2021
@achrinza achrinza added the bug label Sep 18, 2021
@watduh
Copy link

watduh commented Sep 18, 2021

Thanks achrinza

@stale stale bot added the stale label Nov 18, 2021
@loopbackio loopbackio deleted a comment from stale bot Nov 20, 2021
@stale stale bot removed the stale label Nov 20, 2021
@shubhamfuloria
Copy link

I'm facing the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants