title: How do I query a particular field in loopback 4 through the repository?
body: <p>I want to enforce uniqueness so I would like to see if there are any other emails and usernames that are similar to the one posted to this route. How do I do that through the repository, it keeps on asking about a filter which I see but cannot get my head around it.</p>
  
  <pre><code>@post('/users', {
      responses: {
        '200': {
          description: 'User model instance',
          content: {'application/json': {schema: {'x-ts-type': User}}},
        },
      },
    })
    async create(@requestBody() user: User): Promise&lt;User&gt; {
      //check : User= await this.userRepository.create(user);
      //@param.query.object('filter', getFilterSchemaFor(User)) filter?: Filter;
      // var check:any=await this.userRepository.find(filter);
      //filter: Filter;
      var check: User = await this.userRepository.find({email:user.email});
      var isNotPresent: boolean = true;
      // check.forEach(function(val){
  
      // });
      // if(isNotPresent)
      return await this.userRepository.create(user);
    }
  </code></pre>