Skip to content
Back

What are the all possible queries can be passed to ```users.list``` ?

  • 0
  • Self Hosted
  • Functions
  • Auth
Shiba
11 Nov, 2024, 13:18
TypeScript
  final userList = await users.list(queries: [
      Query.offset(offset),
      Query.limit(limit),
      Query.notEqual('accessedAt', ""),
    ]);
TypeScript
AppwriteException: general_argument_invalid, Invalid `queries` param: Invalid query: Attribute not found in schema: $accessedAt (400)
TypeScript
{
    "total": 5,
    "users": [
        {
            "$id": "5e5ea5c16897e",
            "$createdAt": "2020-10-15T06:38:00.000+00:00",
            "$updatedAt": "2020-10-15T06:38:00.000+00:00",
            "name": "John Doe",
            "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L/4LdgrVRXxE",
            "hash": "argon2",
            "hashOptions": {
                "type": "argon2",
                "memoryCost": 65536,
                "timeCost": 4,
                "threads": 3
            },
            "registration": "2020-10-15T06:38:00.000+00:00",
            "status": true,
            "labels": [
                "vip"
            ],
            "passwordUpdate": "2020-10-15T06:38:00.000+00:00",
            "email": "john@appwrite.io",
            "phone": "+4930901820",
            "emailVerification": true,
            "phoneVerification": true,
            "mfa": true,
            "prefs": {},
            "targets": [
                {
                    "$id": "259125845563242502",
                    "$createdAt": "2020-10-15T06:38:00.000+00:00",
                    "$updatedAt": "2020-10-15T06:38:00.000+00:00",
                    "name": "Aegon apple token",
                    "userId": "259125845563242502",
                    "providerId": "259125845563242502",
                    "providerType": "email",
                    "identifier": "token"
                }
            ],
            "accessedAt": "2020-10-15T06:38:00.000+00:00"
        }
    ]
}
TL;DR
Developers want to know possible queries for ```users.list```. One query mentioned is to fetch active users with a specific offset, limit, and accessedAt not empty. However, an error occurred as the attribute ```accessedAt``` was not found in the schema.
Shiba
11 Nov, 2024, 13:19

any query to to fetch list where the user is most active

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more