@Override public String createIndex(final Bson keys, final IndexOptions indexOptions) { return createIndexes(singletonList(new IndexModel(keys, indexOptions))).get(0); }
@Override public String createIndex(final ClientSession clientSession, final Bson keys, final IndexOptions indexOptions) { return createIndexes(clientSession, singletonList(new IndexModel(keys, indexOptions))).get(0); }
'use strict'; var nconf = require('nconf'); var IndexModel = require('../models/index'); module.exports = function (app) { var model = new IndexModel(); //or attach it directly to the app object like so app.set('adventurer', nconf.get('adventurer')); console.log('adventurer directly set on app object', app.get('adventurer')); console.log('controller with app adventurer:', nconf.get('adventurer')); app.get('/', function (req, res) { res.render('index', model); }); };
public ActionResult Index() { return View(new IndexModel()); } [HttpPost] public ActionResult ProcessTech(string SubmitButton) { IndexModel _oTechModel = new IndexModel(); switch (SubmitButton) { case "search": //search technician { _oTechModel.setEnable = true; } break; } return View("Index", _oTechModel); }
connect: (e) -> @model = new IndexModel({country: e.currentTarget.alt, language: window.Language}) $('#spinner_ajax').show() @model.save(null, { success: @success error: @error }) error: (xhr, status, thrown) -> console.log "AJAX Error: #{status}" alert "AJAX Error: #{status}: Server is probably down." $('#spinner_ajax').hide(); no success: (model) -> console.log "Status: #{model.get('status')}" if model.get('status') window.lmStatus = true window.location.hash = 'connection' $('#spinner_ajax p').html('You are being redirected ') else alert 'This connection is currently not active.' $('#spinner_ajax').hide(); no
@Override public String createIndex(final ClientSession clientSession, final Bson keys, final IndexOptions indexOptions) { return createIndexes(clientSession, singletonList(new IndexModel(keys, indexOptions))).get(0); }
@Override public String createIndex(final Bson keys, final IndexOptions indexOptions) { return createIndexes(singletonList(new IndexModel(keys, indexOptions))).get(0); }
@Override public String createIndex(final Bson keys, final IndexOptions indexOptions) { return createIndexes(singletonList(new IndexModel(keys, indexOptions))).get(0); }
@Override public String createIndex(final ClientSession clientSession, final Bson keys, final IndexOptions indexOptions) { return createIndexes(clientSession, singletonList(new IndexModel(keys, indexOptions))).get(0); }
@Override public void createIndexes() { try { getCollection().createIndexes(Arrays.asList(new IndexModel(new Document().append("nodeId", 1)), new IndexModel(new Document().append("created", 1)))); }catch(Exception e){ logger.error("create indexes error:" + e.getMessage(), e); } }
@PostConstruct @Override public void createIndexes() { try { getCollection().createIndexes(Arrays.asList(new IndexModel(new Document().append("nodeId", 1)), new IndexModel(new Document().append("listenerClass", 1)), new IndexModel(new Document().append("eventId", 1)), new IndexModel(new Document().append("fromNodeId", 1)), new IndexModel(new Document().append("eventName", 1)), new IndexModel(new Document().append("eventCreated", 1)), new IndexModel(new Document().append("mdcValue", 1)), new IndexModel(new Document().append("custom", "text")))); }catch(Exception e){ logger.error("create indexes error:" + e.getMessage(), e); } }
public MongoIndex add(MongoIndex mongoIndex) { indexModels.add(new IndexModel(Indexes.compoundIndex(mongoIndex.getBson()), mongoIndex)); return this; }
public MongoIndex add(MongoIndex mongoIndex) { indexModels.add(new IndexModel(Indexes.compoundIndex(mongoIndex.getBson()), mongoIndex)); return this; }
Document indexDocument = new Document(fieldName, sortOrder); if (indexOption == null) { return new IndexModel(indexDocument); } else { IndexOptions indexOptions = new IndexOptions(); "illegal value(s) for index option. Please check your query and try again.", e); return new IndexModel(indexDocument, indexOptions);
/** * Creates a new {@link IndexModel}, which can be used for creating indices using MongoDB Java drivers. * * @return the created {@link IndexModel} */ public IndexModel toIndexModel() { final IndexOptions options = new IndexOptions() .name(name) .unique(unique) .sparse(sparse) .background(background); if (!partialFilterExpression.isEmpty()) { options.partialFilterExpression(partialFilterExpression); } return new IndexModel(keys, options); }
/** * Utility method which can be used to check if the given primary key is valid i.e. non empty * and is made up of attributes and return an index model when PrimaryKey is valid. * * @param primaryKey the PrimaryKey annotation which contains the primary key attributes. * @param attributeNames List containing names of the attributes. * @return List of String with primary key attributes. */ public static IndexModel extractPrimaryKey(Annotation primaryKey, List<String> attributeNames) { if (primaryKey == null) { return null; } Document primaryKeyIndex = new Document(); primaryKey.getElements().forEach( element -> { if (!isEmpty(element.getValue()) && attributeNames.contains(element.getValue())) { primaryKeyIndex.append(element.getValue(), 1); } else { throw new SiddhiAppCreationException("Annotation '" + primaryKey.getName() + "' contains " + "value '" + element.getValue() + "' which is not present in the attributes of the " + "Event Table."); } } ); return new IndexModel(primaryKeyIndex, new IndexOptions().unique(true)); }
/** * Creates a new {@link IndexModel}, which can be used for creating indices using MongoDB Java drivers. * * @return the created {@link IndexModel} */ public IndexModel toIndexModel() { final IndexOptions options = new IndexOptions() .name(name) .unique(unique) .sparse(sparse) .background(background); if (!partialFilterExpression.isEmpty()) { options.partialFilterExpression(partialFilterExpression); } return new IndexModel(keys, options); }