docs
docs copied to clipboard
Add mLab API method of freeing space
Instead of throwing everything out, the mLab API can be used to only remove old records. This can be useful if you use reports a lot.
Followed the instructions, initially trying to clear out treatments. I generated the following put request(removed confidential bits) but got a "{ "message" : "No Content-Type set, expecting 'application/json'."}"
https://api.mlab.com/api/1/databases/herokudatabasenamehere/collections/treatments?q=%7B%0A%20%20%20%20%22created_at%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22%24regex%22%3A%20%22(2018-0%5B1-9%5D.*)%E2%80%9D%2C%0A%20%20%20%20%20%20%20%20%22%24options%22%3A%20%22g%22%0A%20%20%20%20%7D%0A%7D&apiKey=APIKEYHERE
Also, the other entries example is completely confusing, a brief explanation of the lt field would be useful, unless I'm missing something: { "date": { "$lt": 1516838400000 } }
A little closer, I missed putting [] in the body. Now have this error:
{ "message" : "An unexpected error occurred while attempting to insert objects: Could not parse JSON parameter, please double-check syntax and encoding: {\n "created_at": {\n "$regex": "(2018-0[1-9].)”,\n "$options": "g"\n }\n}: \n{\n "created_at": {\n "$regex": "(2018-0[1-9].)”,\n "$options": "g"\n }\n}\n ^"}
I'm super for this change!!!
@rhysjones Could you please post the response you're getting in a code block (surrounded by backticks, or by clicking the <>
button in the GitHub comment field) so it's a bit easier to see what's going on?