Expected: fetch_object with limit=1 returns one data object. Actual: Returns empty

Description

use the following code to request:

filters=wvc.query.Filter.by_property('knowledge_name').equal('QA')
collection=client.collection.get(Flies)
collection.query.fetch_object(filters=filters,limit=1)

Returns: QueryReturn(object=

collection.query.fetch_object(filters=filters,limit=2)

Returns: one data.
My expectation is that when limit=1, one data should also be returned

Server Setup Information

  • Weaviate Server Version: weaviate1.23.7
  • Deployment Method: docker
  • Multi Node? Number of Running Nodes: 3
  • Client Language and Version:4.4.1
  • Multitenancy:no

Any additional Information

I checked the server logs and found no relevant logs.
I think the problem is on the server side, because when I use the crul request, when limit=1, the feedback result is still empty

Hello @ZzzWii,

Welcome to our community, and it’s lovely to have you here.

Your understanding is correct—the limit here should return one object. However, I see you have filters, which could be a case where the filter conditions don’t match any data.

I’m not sure about your data and schema, so it’s difficult to tell for sure.

I would suggest testing by applying the filter without the limit to ensure the filter is working against the data.

Regards,
Mohamed Shahin
Weaviate Support