In my custom object I have two fields Name__c and QuestionString__c
I am trying to initialise a map with Name__c as key and QuestionString__c as value from a SOQL.
Map<String, String> ppmap = new Map<String, String>([SELECT Name__c, QuestionString__c FROM PObj__c]);
I tried the above but I get the error as
Invalid initializer type List found for Map: expected a Map with the same key and value types, or a valid SObject List
Can someone tell me if it is possible to initialize a map directly (without "Id") from SOQL ?