Upsert large amount of documents based on the property value

Is it possible to use Bulk API to upsert large number of documents 100, 1000 ... but i want them to be inserted based on a query for example based on my userId property

Use case for this is that we need to handle thousands of updates of files that we dont know ids to without reeding them all and putting it in redis or something similar