Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mLab API method of freeing space #1266

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Add mLab API method of freeing space #1266

wants to merge 5 commits into from

Conversation

cascer1
Copy link
Contributor

@cascer1 cascer1 commented Apr 26, 2018

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.

@rhysjones
Copy link

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
}
}

@rhysjones
Copy link

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 ^"}

@tomasboudr
Copy link
Contributor

I'm super for this change!!!

@cascer1
Copy link
Contributor Author

cascer1 commented Oct 25, 2018

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants