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

'Query' field does not work with channels.list.joined, groups.list, groups.listAll, im.list #9423

Closed
xbolshe opened this issue Jan 17, 2018 · 3 comments · Fixed by #9424
Closed
Milestone

Comments

@xbolshe
Copy link
Contributor

xbolshe commented Jan 17, 2018

Description:

There is no possibility to use 'query' field with methods like channels.list.joined, groups.list, groups.listAll, im.list becase 'query' is not supported. There is a problem to select rooms with specific properties/regex conditions like customFields.

Server Setup Information:

  • Version of Rocket.Chat Server: 0.61.0-develop on Jan 17, 2018
  • Operating System: Ubuntu Server
  • Deployment Method(snap/docker/tar/etc): Local compilation and launch a bundle
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Disabled
  • Node Version: 8.9.4

Steps to Reproduce:

Using REST API:

  1. Create a group with customFields.field1
  2. Provide a 'query' parameter in groups.list request like { "customFields.field1": "aaa-1"}
  3. Check that only channels with "customFields.field1" = "aaa-1" are in the output
@xbolshe xbolshe changed the title 'Query' field does not fork with channels.list.joined, groups.list, groups.listAll, im.list 'Query' field does not work with channels.list.joined, groups.list, groups.listAll, im.list Jan 17, 2018
@sachinrkeche
Copy link

Hello Devs,
Still I'm not getting the expected result of this , I'm trying to pass the query parameter for this https://ctsichat.mvoipctsi.com/api/v1/groups.list?query= { "customFields.field1": { "$regex": "Coders"}} to filter the list of group but all groups are getting in the response , so using this query I expecting below result,

{
"name": "Coders",
"fname": "Coders",
"t": "p",
"msgs": 0,
"u": {
"_id": "LgHtJ3nDioaStn2dy",
"username": "sachin"
},
"customFields": {
"field1": "AndroidUsers"
},
"ts": "2018-01-24T08:04:45.372Z",
"ro": false,
"sysMes": true,
"_updatedAt": "2018-01-24T08:04:45.372Z",
"_id": "w5SRcgYTvwjxBaWZF",
"usernames": [
"sachin"
]
},

Is their any solution, what i am doing wrong, please help me out.

@xbolshe
Copy link
Contributor Author

xbolshe commented Jan 24, 2018

@sachinrkeche It seems you use Rocket.Chat version 0.59.4.
If you did not modify it, it does not work with groups.list query and returns all groups as expected.

@sachinrkeche
Copy link

@xbolshe, Yes your right, I'm using Rocket.Chat version 0.59.4 , you mean i have to upgrade the the version, Thanks you so much.

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