When you're writing a function to check whether a record exists before you create it, make you sure check *before* you create it!!

Spent ages debugging something earlier which was always returning a hit even though I wasn't expecting it but then I realised the record was being added before I ran my check, therefore always said it was found.

Sometimes I'm an idiot.

  • 0
    Yeh - I remember doing this with mongo and some checks I was doing in a loop.

    This kind of thing can torpedo your productivity.
Add Comment