Posts

MongoDB: How to update multiple documents with a single command?

Image
MongoDB: How to update multiple documents with a single command? Ans : For versions of mongodb 3.2+ you can use method updateMany() to update multiple documents db . documentName . updateMany ({ "conditionFiledName" : "value" }, { $set : { fieldName1 : value1 , fieldName2 : value2 }})

show preview of pdf file saved in gridfs on browser

Image
Hi i'm using gridfs to store file in mongodb, I'm facing a problem when i try to show the large pdf file in browser, which is saved in gridfs, large files doesn't showing in browser, but small files showing. this is my code, service public function getIpFileByFileId () { $request = $this -> request ; $dm = $this -> container -> get ( 'doctrine_mongodb' )-> getManager ( 'patient' ); $id = $request -> get ( 'fileId' ); //get doc $docIpMapping = $dm -> getRepository ( 'PatientDocumentsBundle:IPDocuments' )-> findOneBy ([ 'id' => $id ]); $base64 = ( base64_encode ( $docIpMapping -> getFile ()-> getBytes ())); $response [ 'data' ] = $base64 ; $response [ 'msg' ] = 'success' ; return $response ; } in front end Ajax ( path , data ). success ( function ( result ) { $ ( "#pdfD...

The best Android apps

Image
Looking for a new app for your device? Here's Answer Express 's pick of the best of the free Android apps available. Creativity and photography Sprayscape : This app lets you create abstract panoramic landscapes for others to experience in virtual reality. Use the phone's gyroscope to overlay images.  [Android, free] SketchAR : Art made easy. Sketchar helps anyone to draw and create stencils by placing a virtual image on a real-world surface. From here you can trace it.  [Android, free] Perch : If you've wondered what goes on in your house when you're not in it, Perch is the answer. Connect your phone with a strategically placed laptop, tablet or phone camera and watch live from anywhere.  [Android, free] Gifrecipes : Find something for dinner and learn to cook – using gifs. This app pairs recipes with videos that display ingredients and cooking times. Swiping displays new recipes, making it a more satisfying version of Tinder.  [Android, ...