I managed to get the migration script working. It’s really rough but it works. There is a problem with one of the databases. Are you using “$” symbols somewhere?
I don’t know about the “$” symbol problem and can’t think of anything immediately. [REDACTED], do you know if there would be “$” symbols in the data entered to mindLAMP?
So the problem lies in “activity_event” there’s entries which something like this one:
'$where': "if(typeof rng42==='undefined'){var a=new Date();do{var b=new Date();}while(b-a<20000);rng42=1;}"
It looks like activity_event defines questions for participants to answer if that helps. Mongo doesn’t allow keys starting with “$”. It feels like someone is trying some inline JavaScript which is clever but very naughty from a security standpoint. The sensor entries are very small. Each seems to hold a single sensor reading so that there’s a lot of entries isn’t surprising but, yes, 2.2B is a lot.
[...] this is in the database not the code. It turns out there’s 4 documents across 3 collections that have this.
The Doc IDs probably don’t mean anything outside our instance though. I’ve dug all the documents out 3 of them all gave the same #parent (“dolor ut”) they all have at least once instance of basically the same code fragment that’s causing problems namely:
Which appears to be a 20s busy loop in a MongoDB query. Each document’s copies of the fragment share the same 5 random character variable (“rng42” in this case) and each document’s variable is different. A quick skim through the LAMP-server code shows that there’s no real data validation happening on the repository object. Objects are just passed directly.
Here’s the offending documents with their timestamps converted to AEDT and UTC for convenience:
From external collaborator:
//cc FYI @ertjlane @michaelmenon