Loading TOC...


   [default-partition as Number]
) as element(db.assignmentPolicy)


This function returns an element that represents the query assignment policy. Use the admin.databaseSetAssignmentPolicy function to set the assignment policy.

default-partition Partition number of the default partition.


const admin = require('/MarkLogic/admin');

const config = admin.getConfiguration();
const dbId = admin.databaseGetId(config, 'db1');
const policy = admin.queryAssignmentPolicy(1);

admin.databaseSetAssignmentPolicy(config, dbId, policy);

// Returns the new configuration element -- use admin.saveConfiguration
// to save the changes to the configuration or pass the configuration
// to other Admin API functions to make other changes.

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.