Hi
It’s been some time since you posted this question. Have you found a solution yet?
I like to sent a order that check if element is present in the array, if YES then remeves the element, if NOT then add the element.
Is that possible in a only one sentence?
If you mean is it possible to do logic-based insertion in MongoDB (either through a command or aggregation), then it is not currently possible.
Having said that, the mongo shell is a Javascript interpreter, so you may be able to do what you need using the shell (see the mongo shell and Write Scripts for the mongo Shell). Alternatively, you can write a small script using the various drivers.
Best regards,
Kevin