I can get this to work...
var options = [{id: 1, text: \'Adair, Charles\'}]
$(\'#names\').select2({
data: options,
})
But i cant work
As an update for this old post, having custom properties for id and text is not directly supported anymore since 4.0.0+ version.
See here on "The id and text properties are strictly enforced" text block. You must create a $.map object as a workaround.
Even more, working with an [input type="hidden"] is now deprecated as all core select2 options now support the [select] html object.
Have a look to John S' answer on this post as well.