class UpdateAsyncOperationTask implements IDatabaseTask {

    @Override
    public void prepare(final IObject query) throws TaskPrepareException {

        try {
            IObject document = documentField.in(query);
            doneFlagField.out(document, true);
            upsertTask = IOC.resolve(Keys.getOrAdd("db.collection.upsert"),
                    connection,
                    collectionNameField.in(query),
                    document);
        } catch (ReadValueException | ChangeValueException | ResolutionException | InvalidArgumentException e) {
            throw new TaskPrepareException("Can't prepare query for update into async operation collection", e);
        }
    }

    public  UpdateAsyncOperationTask(final IStorageConnection connection);

}