My question involves criminal records for the state of: CA

Hey so I have been arrested twice this year for possession of hash while I have had a physicians recommendation for the use of medical marijuana during both arrests. In both arrests the hash did not belong to me and in one of the arrests my friend actually told the officer that it was factually his hash, but when he was told he was then going to jail for it he quickly recanted then because it was closest to me because I was in the back seat the officer arrested me on the ride to the station the officer apologized to me saying I know it was your friends hash and not yours but if I would've arrested him then my sergeant might've kicked him loose because he recanted. Both times after being in jail I never saw a judge and was released after 72 hours with a letter saying you we're never arrested only detained. But a few websites have posted things saying that I was arrested and now apparently they are calling me a felon which I am not.

So I would like to file for a Section 851.8 how would I do this and what are the chances of it getting approved?

Please help with this