Package com.mongodb

Examples of com.mongodb.BasicDBList


  private BasicDBList getPlayedCoursesAssociationEmbedded() {
    BasicDBObject bepplePeachRef = new BasicDBObject();
    bepplePeachRef.put( "playedCourses_id", 1L );

    BasicDBList playedCourses = new BasicDBList();
    playedCourses.add( bepplePeachRef );

    return playedCourses;
  }
View Full Code Here


    id.put( "table", "GolfPlayer_GolfCourse" );

    BasicDBObject row = new BasicDBObject();
    row.put( "playedCourses_id", 1L );

    BasicDBList rows = new BasicDBList();
    rows.add( row );

    BasicDBObject association = new BasicDBObject();
    association.put( "_id", id );
    association.put( "rows", rows );
    return association;
View Full Code Here

  private BasicDBList getPlayedCoursesAssociationEmbedded() {
    BasicDBObject bepplePeachRef = new BasicDBObject();
    bepplePeachRef.put( "playedCourses_id", 1L );

    BasicDBList playedCourses = new BasicDBList();
    playedCourses.add( bepplePeachRef );

    return playedCourses;
  }
View Full Code Here

    id.put( "table", "GolfPlayer_GolfCourse" );

    BasicDBObject row = new BasicDBObject();
    row.put( "playedCourses_id", 1L );

    BasicDBList rows = new BasicDBList();
    rows.add( row );

    BasicDBObject association = new BasicDBObject();
    association.put( "_id", id );
    association.put( "rows", rows );
    return association;
View Full Code Here

    public Map<String, String> getStaticFields() {
        if (fields.get(EMBEDDED_STATIC_FIELDS) == null) {
            return Collections.emptyMap();
        }

        final BasicDBList list = (BasicDBList) fields.get(EMBEDDED_STATIC_FIELDS);
        final Map<String, String> staticFields = Maps.newHashMapWithExpectedSize(list.size());
        for (final Object element : list) {
            try {
                final DBObject field = (DBObject) element;
                staticFields.put((String) field.get(FIELD_STATIC_FIELD_KEY), (String) field.get(FIELD_STATIC_FIELD_VALUE));
            } catch (Exception e) {
View Full Code Here

        if (input.getFields().get(InputImpl.EMBEDDED_EXTRACTORS) == null) {
            return Collections.emptyList();
        }

        final ImmutableList.Builder<Extractor> listBuilder = ImmutableList.builder();
        final BasicDBList mEx = (BasicDBList) input.getFields().get(InputImpl.EMBEDDED_EXTRACTORS);
        for (final Object element : mEx) {
            final DBObject ex = (BasicDBObject) element;

            // SOFT MIGRATION: does this extractor have an order set? Implemented for issue: #726
            Long order = 0l;
View Full Code Here

    @SuppressWarnings("unchecked")
    private List<Converter> getConvertersOfExtractor(DBObject extractor) {
        final ImmutableList.Builder<Converter> listBuilder = ImmutableList.builder();

        final BasicDBList converters = (BasicDBList) extractor.get(Extractor.FIELD_CONVERTERS);
        for (final Object element : converters) {
            final DBObject c = (BasicDBObject) element;

            try {
                listBuilder.add(ConverterFactory.factory(
View Full Code Here

    }
   
    public Set<String> getForcedAlarmCallbacks() {
        Set<String> callbacks = Sets.newHashSet();
        SystemSetting s = new SystemSetting(mongoConnection);
        BasicDBList objs = s.getList(KEY_FORCED_ALARM_CALLBACKS);
       
        for (Object obj : objs) {
            String typeclass = (String) obj;
            if (typeclass != null && !typeclass.isEmpty()) {
                callbacks.add(typeclass);
View Full Code Here

        geoNearCommand.put("maxDistance", miles / 69.17);
        geoNearCommand.put("num", limit);
        geoNearCommand.put("spherical", true);

        CommandResult geoNearResult = Model.datastore.getDB().command(geoNearCommand);
        BasicDBList geoNearResults = (BasicDBList) geoNearResult.get("results");

        return Lists.newArrayList(Iterables.transform(geoNearResults, new Function<Object, PostcodeUnit>() {
            @Override
            public PostcodeUnit apply(@Nullable Object input) {
                BasicDBObject pcuObject = (BasicDBObject) ((BasicDBObject) input).get("obj");
View Full Code Here

        AggregationOutput aggregationResult = null;

        // Allow body to be a pipeline
        // @see http://docs.mongodb.org/manual/core/aggregation/
        if (query instanceof BasicDBList) {
            BasicDBList queryList = (BasicDBList)query;
            aggregationResult = dbCol.aggregate((DBObject)queryList.get(0), queryList
                .subList(1, queryList.size()).toArray(new BasicDBObject[queryList.size() - 1]));
        } else {
            aggregationResult = dbCol.aggregate(query);
        }

        dbIterator = aggregationResult.results();
View Full Code Here

TOP

Related Classes of com.mongodb.BasicDBList

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.