Package com.massivecraft.mcore.xlib.mongodb

Examples of com.massivecraft.mcore.xlib.mongodb.BasicDBObject


public class JSONCallback extends BasicBSONCallback {

    @Override
    public BSONObject create() {
        return new BasicDBObject();
    }
View Full Code Here


     * gets the list of files stored in this gridfs, sorted by filename
     *
     * @return cursor of file objects
     */
    public DBCursor getFileList(){
        return getFileList(new BasicDBObject());
    }
View Full Code Here

     *
     * @param query filter to apply
     * @return cursor of file objects
     */
    public DBCursor getFileList( DBObject query ){
        return getFileList(query, new BasicDBObject("filename",1));
    }
View Full Code Here

     * @param id
     * @return
     * @throws MongoException
     */
    public GridFSDBFile findOne( ObjectId id ){
        return findOne( new BasicDBObject( "_id" , id ) );
    }
View Full Code Here

     * @param filename
     * @return
     * @throws MongoException
     */
    public GridFSDBFile findOne( String filename ){
        return findOne( new BasicDBObject( "filename" , filename ) );
    }
View Full Code Here

     * @param sort
     * @return
     * @throws MongoException
     */
    public List<GridFSDBFile> find( String filename , DBObject sort){
        return find( new BasicDBObject( "filename" , filename ), sort );
    }
View Full Code Here

     * removes the file matching the given id
     * @param id
     * @throws MongoException
     */
    public void remove( ObjectId id ){
        _filesCollection.remove( new BasicDBObject( "_id" , id ) );
        _chunkCollection.remove( new BasicDBObject( "files_id" , id ) );
    }
View Full Code Here

     * removes all files matching the given filename
     * @param filename
     * @throws MongoException
     */
    public void remove( String filename ){
        remove( new BasicDBObject( "filename" , filename ) );
    }
View Full Code Here

        int _offset = 0;
        byte[] _data = null;
    }
   
    void remove(){
        _fs._filesCollection.remove( new BasicDBObject( "_id" , _id ) );
        _fs._chunkCollection.remove( new BasicDBObject( "files_id" , _id ) );
    }
View Full Code Here

        if ( _fs == null )
            throw new MongoException( "no _fs" );
        if ( _md5 == null )
            throw new MongoException( "no _md5 stored" );
       
        DBObject cmd = new BasicDBObject( "filemd5" , _id );
        cmd.put( "root" , _fs._bucketName );
        DBObject res = _fs._db.command( cmd );
        if ( res != null && res.containsField( "md5" ) ) {
            String m = res.get( "md5" ).toString();
            if ( m.equals( _md5 ) )
                return;
View Full Code Here

TOP

Related Classes of com.massivecraft.mcore.xlib.mongodb.BasicDBObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.