Users Endpoint

Use case - Retrieve all users that are registered from Los Angeles, CA.

Request:GET /users?fs={firstname, lastname, city, state}&s={"$query" : {"city" : "Los Angeles", "state", "CA"}}

Field Selector:

{ 
  firstName, 
  lastNAme, 
  city, 
  state
}

Query:

{
  "$query" : {
    "city" : "Los Angeles", 
    "state", "CA"
  }
}

Response payload:

{
  "pager" : {},
  "data" : [
      {
        "firstName": "John",
        "lastName": "Doe",
        "city": "Los Angeles",
        "state": "CA"
      },
      {
        "firstName": "Jane",
        "lastName": "Doe",
        "city": "Los Angeles",
        "state": "CA"
      },
      {
        "firstName": "Bob",
        "lastName": "Doe",
        "city": "Los Angeles",
        "state": "CA"
      }
  ]
}

Use case - Retrieve all male users from california that have a facebook, twitter, or instagram account.

Request:GET /users?fs={firstname, lastname, state, socialNetworks{name, gender}&s={"$query" : {"state" : "CA","socialNetworks.gender" : "Male","socialNetworks.name" : {"$in" : ["Facebook", "Twitter", "Instagram"]}}}

Field Selector :

{
  firstname, 
  lastname, 
  state, 
  socialNetworks {
    name,
    gender
  }
}

Query:

{
  $"query" : {
    "state" : "CA",
    "socialNetworks.gender" : "Male",
    "socialNetworks.name" : {
      "$in" : ["Facebook", "Twitter", "Instagram"]
    }
  }
}

Response payload:

{
  "pager" : {},
  "data" : [
      {
        "firstName": "John",
        "lastName": "Doe",
        "state": "CA",
        "socialNetworks": [
          {
            "name": "Facebook",
            "gender": "Male"
          },
          {
            "name": "Twitter",
            "gender": "Male"
          }
        ]
      },
      {
        "firstName": "Bob",
        "lastName": "Doe",
        "state": "CA",
        "socialNetworks": [
          {
            "name": "Facebook",
            "gender": "Male"
          },
          {
            "name": "Twitter",
            "gender": "Male"
          },
          {
            "name": "Instagram",
            "gender": "Male"
          }
        ]
      }
  ]
}