8

How can I save with a empty ObjectId. I wanna create a item, thats not attach to any user yet. So the owner has to be a empty ObjectId.

How to do this?

techbech
  • 3,754
  • 5
  • 20
  • 28
  • 1
    You could have tried with null, without asking a question here... – Amol M Kulkarni Mar 21 '13 at 08:12
  • 2
    @AmolMKulkarni While I agree that trying is the best way, I don't think it's bad to have a question here. Many questions here could have been solved by "just trying to do the right thing instead of asking". – Camilo Martin Aug 17 '14 at 15:40

1 Answers1

14

If you made the owner a required field then you must set a value, otherwise you may leave it null/undefined when saving.

aaronheckmann
  • 10,625
  • 2
  • 40
  • 30